Commit Graph

353 Commits

Author SHA1 Message Date
Andrea Maria Piana d22182ea82 Ban user from community
This commit introduces a new endpoint to ban a user from a community.

Messages from this user will be ignored.
2021-03-24 09:29:21 +01:00
Shivek Khurana 1097b14a7f
🎭 📊 Anonymous Metrics V0 (#2170)
* Migrations in place, how to run them?

* Remove down migrations and touch database.go

* Database and Database Test package in place, added functions to get and store app metrics

* make generate output

* Minor bug fix on app metrics insert and select

* Add a validation layer to restrict what can be saved in the database

* Make validation more terse, throw error if schema doesn't exist, expose appmetrics service

* service updates

* Compute all errors before sending them out

* Trying to bring a closjure to appmetrics go

* Expose appmetrics via an api, skip fancy

* Address value as Jason Dawt Rawmasage to ease parsing

* Introduce a buffered chan with magic cap of 8 to minimize writes to DB. Tests for service and API. Also expose GetAppMetrics function.

* Lint issues

* Remove autoincrement, undo waku.json changes, fix error being shadowed, return nil where nil ought to be returned, get rid of buffered channel

* Bump migration number

* Fix API factory usage

* Add comment re:json.RawMessage instead of strings

* Get rid of test vars, throw save error inside the loop

* Update version

Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2021-03-17 18:09:28 +05:30
Andrea Maria Piana f75f7bb738 Expand confirmations to private group chat messages
This commit expands the confirmation mechanism to allow private group
chat messages to be confirmed:

Changes:

- Added a separate table for message confirmations as group chat
messages have same messageID but multiple datasyncID
- Removed DataSyncID from raw message (I haven't removed the column name
as it can't be done in sqlite without copying over the table)
2021-03-16 13:41:14 +01:00
Roman Volosovskyi a7f2e94999
[wallet] Store account's last known balance and nonce 2021-03-15 16:18:12 +02:00
Andrea Maria Piana e29cca667a linting 2021-03-05 16:05:56 +01:00
andrey 38b0401acd fix bug from status-react 2021-03-05 16:05:56 +01:00
Andrea Maria Piana 290f21d9ba Fix missing chat from notifications 2021-03-05 16:05:56 +01:00
andrey 66c78c6a7f don't sync profile and timeline chats 2021-03-05 16:05:56 +01:00
Andrea Maria Piana 0a686bba4c Fix syncing of public chats
Timeline chats are created as public chats, in any place where we sync
them we need to check that they are excluded.
2021-03-03 08:57:48 +01:00
Andrea Maria Piana f115b8d289 Request/Decline access to communities 2021-02-26 15:35:43 +01:00
Roman Volosovskyi 99a304686f
Filter message PNs on status go side 2021-02-25 10:19:10 +02:00
Frank Tang 42ab47a9ee fix "Pending" status for messages in private group chat 2021-02-24 08:17:24 +01:00
Volodymyr Kozieiev c38439e664
Listen for delivered messages (#2150) 2021-02-23 17:47:45 +02:00
Samuel Hawksby-Robinson 730f540a0b
Adding Transactions messages to the localnotifications (#2142)
* Revert "Revert "Expand Local Notifications to support multiple Notification types (#2100)""

This reverts commit 5887337b88.

* Revert "Revert "fix protocol.MessageNotificationBody marshalling""

This reverts commit cf0a16dff1.

* Bump version to 0.70.0

* Added localnotifications for Transaction messages

* Fixed bug where Message.SigPubKey was presumed to be set

* Added lookup for contact existing in Messenger.allContacts

Additionally added functionality to add a contact to the messenger store if it isn't present

* Get chat directly from Messenger.allChats store

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2021-02-23 07:37:08 +00:00
Andrea Maria Piana 31b9a924ce Fix image messages being dropped in profile chats
It looks like profile chats are created as public chats, and the code
will drop messages for it.

This commit fixes the issue by checking for the "@" prefix in profile
chat names, until we fix the issue by migrating those chats.
2021-02-15 20:07:41 +01:00
Andrea Maria Piana 6ac1c43926 Add status.im and medium.com to link unfurling 2021-02-15 11:51:14 +01:00
Andrea Maria Piana add5040b48 Drop image messages in public chats
Currently image messages are actually displayed, we only prevent
sending.
This commit changes the behavior so that we drop them.
2021-02-15 08:47:41 +01:00
Andrea Maria Piana eec9518825
Revert "Revert "fix protocol.MessageNotificationBody marshalling""
This reverts commit cf0a16dff1.
2021-02-05 16:48:46 +02:00
Andrea Maria Piana 84db2fb472
Revert "Revert "Expand Local Notifications to support multiple Notification types (#2100)""
This reverts commit 5887337b88.
2021-02-05 16:48:45 +02:00
Shivek Khurana 8d9b85f103 Fix linting 2021-02-05 15:12:38 +01:00
Shivek Khurana 0feab5c6a7 Handle media.giphy.com and expose dimensions of gifs 2021-02-05 15:12:38 +01:00
Shivek Khurana 757dbcd98e Change giphy short url, was gph.is but was using gph.se 2021-02-05 15:12:38 +01:00
Shivek Khurana 4b5dbc3d52 Fixed linting 2021-02-05 15:12:38 +01:00
Shivek Khurana ad6229bc4f Follow short urls to get long url and then use that long url with oembed 2021-02-05 15:12:38 +01:00
Shivek Khurana 499f1702d1 Whitelist media.giphy.com 2021-02-05 15:12:38 +01:00
Shivek Khurana 55f7ad7496 Make errors start with lower case 2021-02-05 15:12:38 +01:00
Shivek Khurana 3fb75919ce Go linter thinks that I'm a 12 year old going on a solo trip to China 2021-02-05 15:12:38 +01:00
Shivek Khurana 12a47b7893 Ignore Giphy load balancer urls 2021-02-05 15:12:38 +01:00
Shivek Khurana 63a6c917fe if -> switch/case 2021-02-05 15:12:38 +01:00
Shivek Khurana 2039305900 Fix lint 2021-02-05 15:12:38 +01:00
Shivek Khurana d37b7a9729 Tenor unfurling + connected Giphy and Tenor to GetPreviewData fn 2021-02-05 15:12:38 +01:00
Shivek Khurana 47e17624d6 Giphy oembed in place 2021-02-05 15:12:38 +01:00
Andrea Maria Piana ee8f333dbf Avoid concurrent access to contacts
We were not locking before accessing the contacts map and it would panic
in some cases.

I have changed the code to pull contacts from db so we move away from
having locks.
2021-01-27 10:54:52 +01:00
Andrea Maria Piana f73fb9c3f6
Merge branch 'bug/saved-mailserver-topics' into develop 2021-01-26 12:42:14 +01:00
Andrea Maria Piana 5887337b88
Revert "Expand Local Notifications to support multiple Notification types (#2100)"
This reverts commit 46157dc4dc.
2021-01-26 09:40:05 +01:00
Andrea Maria Piana cf0a16dff1
Revert "fix protocol.MessageNotificationBody marshalling"
This reverts commit fbec17af18.
2021-01-26 09:40:04 +01:00
Andrea Maria Piana a1b3e3a772
Clean topics that we don't listen to
There was a bug on status-react where it would save filters that were
not listened to.
This commit adds a task to clean up those filters as they might result
in long syncing times.

This commit also returns topics/ranges/mailserves from messenger in
order to make the initialization of the app simpler and start moving
logic to status-go.

It also removes whisper from vendor.
2021-01-26 09:39:57 +01:00
Andrea Maria Piana fb6411af24
Use personal topic for push notification registration
One of the issues we noticed is that the partitioned topic
in push notification is heavy in traffic, as any user using a particular
mailserver will use that partitioned topic to register for PNs.

This commit moves from the partitioned topic to the personal topic of
the PN server, so it does not clash with other users that might happen
to have the same partitioned topic as the mailserver, resulting in long
sync times.

Another issue that will need to be addressed separately is that once you
send a message to a topic, because of the way how waku/whisper works,
you will have to register to that topic, meaning that you will receive
that data. Currently waku does not support unsubscribing from a topic
without logging in and out, so that needs also to be addressed.
2021-01-26 09:39:53 +01:00
Andrea Maria Piana 9d2117e227
Send abridged version of history with messages in group chats
When sending a message in a private group chat we send the whole history
for redundancy and allow out-of-order processing.
This can be very expensive in some chats, resulting in long delay when
sending a message and calculating the POW.
This commit improves the performance  by only forwarding the events
necessary for the user to be able to construct a group chat and process
correctly the message.
2021-01-26 09:39:52 +01:00
Andrea Maria Piana d7772d3fc6
Skip wrapping emojis in private group chats
This commit fixes a couple of issues:
1) Emojis were sent to any member of the group chat, regardless of
whether they joined
2) We don't want to wrap emojis, as there's no need to do so, only
messages are to be wrapped
2021-01-26 09:39:47 +01:00
Volodymyr Kozieiev 31f2196cb2 Fix segmentation failure on mailserver 2021-01-26 08:28:24 +01:00
Andrea Maria Piana e3969a7752 Cache waku messages
This commit re-introduces a feature that we lost during the migration to
status-go.
Messages are cached for a couple of days if processed correctly by
status-go, to avoid performance issues.
2021-01-18 09:38:27 +01:00
Roman Volosovskyi fbec17af18 fix protocol.MessageNotificationBody marshalling 2021-01-15 14:00:51 +01:00
Andrea Maria Piana b5b1e19c24 Add ProfilePicturesVisibility 2021-01-15 13:39:13 +01:00
Andrea Maria Piana 665bc3743c Fix push notification flaky test 2021-01-15 13:02:10 +01:00
Samuel Hawksby-Robinson 46157dc4dc
Expand Local Notifications to support multiple Notification types (#2100)
* Initial work on expanding Local Notifications

Adding functionality to support multiple notification types in Notification.Body. Currently have a bug that I think is caused by a the jsonMarshal func not working as intented, need to resolve this next before proceeding

* Fixed json.Marshaller issue and implemented json.Unmarshaller

* Tweak errors, go convention is errors don't begin with capital letters

* Added notificationMessageBody with un/marshalling

Also removed the Body interface

* Added check for bodyType mismatch

* Implement building and sending new message notifications

* Refactor to remove cycle imports

* Resolved linting issue ... Hopefully

* Resolving an implicit memory aliasing in a for loop

* version bump

* Added Notification.Category consts
2021-01-12 14:28:27 +00:00
Andrea Maria Piana b331b61807 Add ClearHistory & DeactivateChat methods 2021-01-11 13:36:05 +01:00
Frank Tang 922e785512 Add GitHub to whitelist for URL unfurling #11426 2021-01-11 11:15:09 +01:00
Andrea Maria Piana 4084c9d82c Don't resend automatically group chat messages
Since we fixed re-sending of messages, it has been noticed a performance
degradation in private group chats.
This is due to too aggressive re-sending of messages.
This commit disables resending of private group chat messages for now
(same as 1.9, so no changes), but keeps it enabled for 1-to-1s.
2021-01-11 09:01:26 +01:00
Andrea Maria Piana cd21f9b0e2 Fix retry count in push notifications
In some instances the retry mechanism would get into a busy loop.
That's due to the fact that we would fetch some non-retriable
notifications but not act on them.

This commit fixes the issue by filtering them from the database query
and making sure that we at least wait 1 second.
2021-01-11 09:01:26 +01:00