Commit Graph

416 Commits

Author SHA1 Message Date
Eric Mastro 4d8d3fb0e8
feat: Add edit communities (#2229)
* feat: Add edit communities

Allow Communities to be edited, including display name, description, color, membership, and permissions.

* Added EditCommunity request type

* Fix lint errors

* Allow editing community without changing image

Previously, retaining an existing community image was not possible because the existing community image path had to be provided in the `editCommunity` RPC call to retain the image. However, once the image is processed by status-go, it is encoded as a base64 string and therefore it is not possible to get the original file path back from this string.

This commit allows for the original to be retained by passing an empty string for the image field in the RPC call.

* Don't change permissions. Fixed clock updating

Co-authored-by: Volodymyr Kozieiev <vkjr.sp@gmail.com>
2021-05-18 15:32:15 -04:00
Pascal Precht dd49e604d4 feat: introduce new `joined` property in `Chat` struct
This property is useful for clients to know when a channel or chat
was joined so they can use that to calculate the order of channels
and chats shown in applications.

Changes include a new joined property on the Chat struct,
as well as adjustments in the persistence layer to retreive and
update chat data in the database.

In addition there's a migration script that alters the existing
chat table to introduce a new column for the joined field.
It also updates all existing rows in the database to set `joined`
to `0`.
2021-05-18 11:29:03 +02:00
Andrea Franz e9a42bfa2b
add PinMessage and PinnedMessage (#2180)
* add PinMessage and PinnedMessage

* fix gruop pin messages

* add SkipGroupMessageWrap to pin messages

* update pinMessage ID generation to be symmetric
2021-05-14 23:22:50 +02:00
Roman Volosovskyi 6037570901
[wallet] Pending transactions API 2021-04-23 18:20:38 +03:00
Andrea Maria Piana 3e80b1ecaa Dont show notification from inactive chats 2021-04-23 08:16:35 +02:00
Volodymyr Kozieiev 9241903edb
Refactorings: whisper transport removed (#2200) 2021-04-22 16:36:18 +03:00
Volodymyr Kozieiev 8a370c1c41
Request info about community from mailserver (#2177) 2021-04-19 15:09:46 +03:00
Andrea Maria Piana c739f73f49 Add activity center & messages from contacts only 2021-04-16 20:42:40 +02:00
Samuel Hawksby-Robinson 759f7bbeb3 Added granual locking on Messenger 2021-04-16 20:42:40 +02:00
Samuel Hawksby-Robinson 6d7028a8d9
Added Anonymous Metrics Send Opt-In Setting (#2195)
* Added anon metrics send opt in setting

* resolved rebase conflict, renamed migration to use unixtimestamp

Theres always conflicts with migrations using sequential numbers, less so with unix timestamp
2021-04-13 14:00:18 +01:00
Shivek Khurana 79bf90e990
👮🏽‍♂️ Update validators and add a new event (#2189)
* Add extra event to capture other type of navigations, allow empty screen name, rename cofx to get rid of clj ns, update tests

* Some view ids are greater than 16 characters. Made it 32 to be safe.

* Tab navigation events occur outside nav, add a new validator for them

* Remove navigate to cofx event, capture screens on will focus, get rid of enum and make valid screens a string less than 32 characters

* Run make generate

* Fix test

* Bump version to 0.75.1
2021-04-12 17:55:53 +05:30
Shivek Khurana 9ef4971fe1
Comment out Medium unfurling (#2193) 2021-04-12 14:49:34 +05:30
Andrea Maria Piana c55659b4f6
Add community notifications (#2160)
This commit introduces the following changes:

- `local-notifications` require as body an interface complying with
`json.Marshaler`
- removed unmarshaling of `Notifications` as not used (we only Marshal
notifications)
- `protocol/messenger.go` creates directly a `Notification` instead of
having an intermediate format
- add community notifications on request to join
- move parsing of text in status-go for notifications
2021-03-31 18:23:45 +02:00
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
Andrea Maria Piana 6f088bb5c5 Fix communities migration
In some instances the communities migration would be skipped but not
marked as `dirty`.

This commit addresses the issue by:
- Making sure that if dirty is set the migration is not skipped but
replayed
- If the version is on the communities migration and dirty is false, we
check for the presence of the communities table. If not present we
replay the communities migration.
- Make community_id field in user_messages nullable

It also removes all the `down` migration, as we can't use them
effectively, as explained in the README.md added.
2021-01-08 08:43:16 +01:00
Andrea Maria Piana 7387049d4b Upgrade linter and address issues 2020-12-28 16:55:14 +01:00
Andrea Maria Piana f5482ec187 Remove filters 2020-12-23 17:20:55 +01:00
Andrea Maria Piana 06dcf0cea9 Allow emoji reactions 2020-12-23 17:20:55 +01:00
Andrea Maria Piana f3afa962c6 Delete messages from chat when leaving org 2020-12-23 17:20:55 +01:00
Andrea Maria Piana b4905fdbd4 address feedback 2020-12-23 17:20:55 +01:00
Andrea Maria Piana 3be6d86326 Remove user from community 2020-12-23 17:20:55 +01:00
Andrea Maria Piana a0d5f66c8f Leave import community data 2020-12-23 17:20:55 +01:00
Andrea Maria Piana 5d929c3584 Handle organisation membership requests 2020-12-23 17:20:55 +01:00
Andrea Maria Piana 84e91d85d2 Consolidate test methods 2020-12-22 15:43:48 +01:00
Andrea Maria Piana 4185420897 Send image on update
This commit changes the behavior so that when the image is updated it
will be published on the contact code topic.
If that does not happen because we are offline, it will be scheduled for
the next time we are online.
2020-12-22 15:43:48 +01:00
Eric Mastro 149877a939
feat: allow getPreviewLinkData for all whitelisted links (#2094)
* feat: allow getPreviewLinkData for all links

Only YouTube links were supported in `getPreviewLinkData` previously.

Now, any whitelisted links can have their data retreived using this function, returning the true content type (by examining the header bytes of the content).

feat: add tenor.com and giphy.com to whitelisted urls list

* Fix json format

* bump VERSION

* Lint urls.go

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2020-12-18 19:33:24 +11:00
Andrea Maria Piana cdca42b90f Dont lock on envelope sent 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson b3187abce1 Fix for int64 pointer bug 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson ba559c5291 Handled errors from defer rows.Close() and tx.Commit() 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 0db7a23d5f Added chatContext type and set chatContext consts 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 0a93513531 Add images field to HasCustomFields 2020-12-17 14:10:00 +01:00
Andrea Maria Piana ac37e4f412 Add multiaccount to push notification tests 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson e0eb96a992 Fix failing tests due to account not present in test env 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson ca80140c1a Resolved broken tests 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 31a885ced8 remove photo path in favor of images in contact 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 1adfa38611 Check hash in shouldPublish 2020-12-17 14:10:00 +01:00
Andrea Maria Piana b7a6bbf1e7 dont send if empty images 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 69de77c36a return error on nil image 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 16fecf5520 Passing Master info to Messenger 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 0b6061b444 Added ChatIdentity to HandleApplication() 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 279c395f23 Added heavy logging to the chat identity builder 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson fe9e04ca13 Updating debug lvl to info 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 481c9c1287 Added debug to HandleChatIdentity 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 0df825164c Placating the linting old ones 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 5d0906b9d8 Resolving fix for receiving chat identities with empty images map 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 43b8e94b2b Resolved an additional fail test related to multiaccounts in the Messenger 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 0c1ebaa547 Resolving goimports lint ... :/ 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 5aa8492315 Fix failing tests 2020-12-17 14:10:00 +01:00
Andrea Maria Piana 32907b59b2 Fix linting 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 1b527906ee Resolved hopefully the last of the lint 2020-12-17 14:10:00 +01:00
Samuel Hawksby-Robinson 7b2d96de05 Resolved yet more lint 2020-12-17 14:10:00 +01:00