Commit Graph

123 Commits

Author SHA1 Message Date
Jonathan Rainville 4f013cc7af fix(edits): mark edits as Mentioned if the og message was not a mention
Marks Edit messages as Mentioned when the original message was not Mentioned and the Edit is, so that we increase the unviewed count only once
2023-03-31 10:12:38 -04:00
Boris Melnik 696e061861
fix(unread_count): Skip extra count of new messages for album of images (#3345)
* fix(unread_count): Skip extra count of new messages for album of images

* fix(unread_count): Update migration files
2023-03-31 12:15:06 +03:00
Sale Djenic f10bd00ceb feat: `keypair_name` and `last_used_derivation_index` columns added to `accounts` table
- `keypair_name` added to `accounts` table, all accounts derived from the
same master key have the same keypair name and also no two keypairs share
the same keypair name (keypair name is unique per keypair)
- `last_used_derivation_index` added to `accounts` table, cause we need
to maintain the highest index been used for the derivations made within
the same keypair
2023-03-28 16:19:27 +02:00
Pascal Precht 051314aad0 feat: add verified wallet accounts to community requests
This commit extends the `CommunityRequestToJoin` with `RevealedAddresses` which represent wallet addresses and signatures provided by the sender, to proof a community owner ownership of those wallet addresses.

**Note: This only works with keystore files maanged by status-go**

At high level, the follwing happens:

1. User instructs Status to send a request to join to a community. By adding a password hash to the instruction, Status will try to unlock the users keystore and verify each wallet account.
2. For every verified wallet account, a signature is created for the following payload, using each wallet's private key

   ``` keccak256(chatkey + communityID + requestToJoinID) ``` A map of walletAddress->signature is then attached to the community request to join, which will be sent to the community owner
3. The owner node receives the request, and if the community requires users to hold tokens to become a member, it will check and verify whether the given wallet addresses are indeed owned by the sender. If any signature provided by the request cannot be recovered, the request is immediately declined by the owner.
4. The verified addresses are then added to the owner node's database such that, once the request should be accepted, the addresses can be used to check on chain whether they own the necessary funds to fulfill the community's permissions

The checking of required funds is **not** part of this commit. It will be added in a follow-up commit.
2023-03-22 13:50:25 +01:00
Boris Melnik 1453f5a0e3
fix(activity_center): Add remove activity center notifications array to message response (#3277) 2023-03-16 21:41:53 +03:00
Roman Volosovskyi 290579f74f
Update wakuext_buildContact 2023-03-14 16:57:33 +01:00
yqrashawn 475b5f855f
feat: allow group admin to delete others message (#3259) 2023-03-07 22:38:09 +08:00
Sale Djenic b660672a60 chore(accounts): `type` column from `accounts` table updated
`type` column is set for all rows to appropriate value. Before this change
accounts which were generated from the keypair created importing seed phrase
had `generated` value for the `type`.

According to above, a function for generating an account sets the `type`
based on the passed derive from address.
2023-03-07 11:28:06 +01:00
Roman Volosovskyi 6cdc0ed5a1
Fix syncing of contact request local state 2023-03-02 11:26:50 +01:00
Andrea Maria Piana f77bff6d25 Add primary & secondary names 2023-02-27 15:13:43 +00:00
Icaro Motta 999d8c0ee0
Support soft deletion for activity center notifications (#3201)
Adds a new column named `deleted` to the table `activity_center_notifications`. 

Related PR in Mobile https://github.com/status-im/status-mobile/pull/15106 for a lot more details of the feature.

Why? Relying on the `dismissed` column for soft deletion is no longer viable because the mobile & desktop clients should display dismissed notifications (sometimes), hence the need for a new column to truly represent soft deletion.
2023-02-24 20:47:04 -03:00
Alexander 27730057d0
Support outgoing contact requests (#3120)
* Outgoing contact requests

* Test fix

* Test fix

* Fixes

* Bugfixes

* Bugfixes

* Almost there

* Removed the activity center notification

* Test update

* Almost ready

* Fixes

* Fixes
2023-02-21 19:08:11 +01:00
Vitaliy Vlasov 2f41034b47 Fix sync_device_test 2023-02-17 12:10:44 +02:00
Vitaliy Vlasov 83a6dbfa3e Update account name during displayName setting syncing 2023-02-17 12:10:44 +02:00
Mikhail Rogachev f25088483c
feat: Add seen/unseen activity center setting (#3148)
* feat: Add seen/unseen activity center state

* feat: ActivityCenterState for grouping ActivityCenter unread messages cnt and seen state

* feat: always use messenger's addActivityCenterNotification & add state to the response

* Remove unused activity center endpoints form api and fix test
2023-02-17 14:08:08 +04:00
Andrea Maria Piana dab0e5d6d3 Make sure message has correctly set contact notification state
In case we received a message with propagated state, the message state
wasn't correctly set in the database.
2023-02-16 16:14:59 +00:00
Andrea Maria Piana 0b2f0ef289
Sync display names 2023-02-15 12:14:27 +00:00
Andrea Maria Piana b69042e7d7 Fix duplicated notifications on receiving contact update
This commit fixes an issue where when accepting a contact request
the other end would display an extra notification.

It also changes WaitOnResponse to collect results. This should make
tests less flaky, since sometimes messages are processed in different
batches.
Now we need to be though exact on what we expect from the response (i.e
use == instead of >, otherwise the same behavior applies)
This uncovered a couple of issues with messenger.Merge, so I have moved
the struct to use a map based collection instead of an array.
2023-02-14 09:22:37 +00:00
Andrea Maria Piana dea21f440a Linting and some fixes on contact requests handling 2023-02-08 17:48:09 +00:00
Andrea Maria Piana 7523ff1104 Handle a few edge cases in contact requests 2023-02-08 17:48:09 +00:00
Roman Volosovskyi 7360e07224
Update AC notification on EditMessage 2023-02-08 16:29:24 +01:00
Andrea Maria Piana c38ec00a2d Add community request to response when a response handled
In general, any time a piece of state is updated in the backend, that
should be propagated to the client through signals.

In this case, when a request was accepted, the client wasn't notified,
requiring them to re-fetch the accepted requests and causing
inconsistent state between status-go and client.
2023-02-07 13:17:19 +00:00
yqrashawn d4ec412df2
feat: add deleted by xxx support (#3077) 2023-02-01 08:57:35 +08:00
Andrea Maria Piana cefa0089dc
Split clock values for contacts 2023-01-31 15:43:00 +00:00
Alexander a3f59e223c
Fix for syncing settings (empty field is not getting added) (#3147)
* Fix for syncing settings (empty field is not getting added)

* Version bump
2023-01-31 14:37:41 +01:00
Mikhail Rogachev ee9f8edfcf
Mark as read acivated notifications with CTA (#3126)
* fix: Accepting or dismissing contact request should mark AC notification as read

* fix: Accepting or declining community request should mark AC notification as read

* fix: Read notification status fo identity verification requests

* fix: Save whole notification object while handling contact requests

* fix: Remove unused functions from activity_center_persistence

* fix: Use Accepted and Dismissed flags for AC notifications with CTA

* fix: Mark notification as unread when we handle accepted verification request

* fix: Replace Warn with Error on fail to save notification, test fixes

* fix: Fix conditions for fetching AC notifications from the db

* fix: Review fixes for err name and conditions array
2023-01-28 13:52:53 +04:00
Roman Volosovskyi 1d9d7343c3
Fix activation of deleted chat on contact update 2023-01-25 11:12:34 +01:00
Pascal Precht b5964348a1 fix(communities): ensure archive import is only cancelled if not already marked as such
There were cases where this caused a crash, as handling magnetlinks would try to close
an already closed tasked channel

See https://github.com/status-im/status-desktop/issues/8996 for more information.

This commit extends the task struct such that it can be marked as cancelled and safely
read and written by multiple go routines.
2023-01-24 08:58:40 +01:00
Pascal Precht 81d4b5e0d7 fix(communities): only update last seen magnetlink when download was successful 2023-01-20 17:17:13 +01:00
Pascal Precht f85c500e9a Resume import of message history archives upon bootstrap
This adds the functionality that history archives continue to be imported
in case the import has been interrupted the last time the app/client
was running.

This typically happens when users don't wait for an ongoing import to finish,
which sometimes can take a while. Users then close the app/kill the client
which leaves the database in a state where there's downloaded archives that
haven't been fully imported.

Prior to this change, the node will have to wait until it receives a new
magnetlink that it hasn't seen before, until it processes imports again.
This can take several days.

Now, it will check on startup if there are any archives left to be imported
and resumes the import from there.
2023-01-20 07:57:24 +01:00
Pascal Precht 1bab7ae056 refactor(communities): improve archive handling memory pressure
Instead of loading the entire torrent file into memory when trying
to extrract active messages, we now only read the chunks that are
necessary to decode any individual archive and then process
extracted messages in chunks.

This doesn't introduce a max cap of allowed memory yet, since the
chunk size depends entirely on the size of the archive, but this
will be done soon.
2023-01-18 15:45:13 +01:00
frank 4406931582
fix: should include ContactRequestState and HasAddedUs when sync contact (#3100) 2023-01-18 16:12:27 +08:00
Andrea Maria Piana ed9ca8392c Upgrade linter to 1.50.0 2023-01-13 17:52:03 +00:00
Jonathan Rainville 7717f9519f fix(message_handler): fix error when there is no record and fix crash 2023-01-12 11:47:38 -05:00
Roman Volosovskyi d60c1d00ed
Update chat clock on group event 2023-01-12 11:01:45 +01:00
frank a29511b921
update account name if necessary (#3072) 2023-01-12 11:00:24 +08:00
Jonathan Rainville c4bf60b815 feat: make replies act as mentions
and add a reply test to the messenger
2023-01-10 13:39:57 -05:00
frank bea710c8be
fix inconsistent contact request state (#3056) 2023-01-06 18:24:39 +08:00
frank fe2270540e
fix TestGroupChatMembersRemoval sometimes failed (#3037) 2023-01-05 23:37:50 +08:00
frank 9137257638
synchronize display name (#2989) 2022-12-29 14:16:19 +08:00
Mikhail Rogachev 5005b7b3cf
feat(ActivityCenter): Add missing AC notifications for verification requests (#3029)
* feat(ActivityCenter): Add missing AC notifications for verification requests
* fix(Contacts): Fix updates for trusted and untrustworthy statuses
* feat(ActivityCenter): Add test for trusted verification request and AC notifications
* feat(Contacts): Trusted and untrustworthy statuses should be unknown for verificated side
2022-12-26 08:35:46 +04:00
Sale Djenic 1340a55c1d feat: backup profile data to waku and sync them from waku
Changes applied here introduce backing up profile data (display name and identity
images) to waku and fetch them from waku. Information about those data is sent
as a separate signal to a client via `sync.from.waku.profile` signal.

New signal `sync.from.waku.progress` is introduced which will be used to notify a client
about the progress of fetching data from waku.
2022-12-23 15:07:14 +01:00
Pascal Precht b4bdfd3df6 Keep track of last seen magnetlink
This is to prevent processing magnetlinks if they haven't changed
2022-12-20 15:16:08 +01:00
Pascal Precht dd8be1d8b0 feat(communities): add magnetlink to RequestToJoinResponse
This is done so that when member join a community by being accepted by
the community owner, they also receive the most up-to-date magnetlink
along with it.
2022-12-14 13:43:43 +01:00
Pascal Precht f5dfa58602 refactor(communities): better archive download handling
This commit makes a few changes to the community history archive
download routine to make it more robust:

1. Prior to this commit, even when there were no archives to be
   downloaded, we were still trying to extract messages from archive
   data.
2. Logs have been improved as they were sometimes showing confusing
   information
3. We now handle interruption of ongoing download + data import much
   better in case of multiple magnetlinks being processed in roughly the
   same time.
4. We now keep track of which archive has been successfully imported
   into the database. Without this, Status would consider any downloaded
   archives as "done" even though they haven't actually been imported
   into the database yet. This way Status should be able to pick up its
   work were it left of the last time, in case a user closes the app, or
   another magnetlink interrupts the ongoing process.
2022-12-13 16:13:15 +01:00
Jonathan Rainville d87ed0e357 fix(community): don't delete chat and messages when leaving community
This creates a smoother experience for users when they leave a community since they can see the exact same messages they had before without having to rely on the mailserver.
2022-12-09 14:43:56 -05:00
Pascal Precht 22b5690cda feat: add signal indicating that history messages are being imported
In order to give clients more insights about archive messages being
processed, we're adding this additional signal that informs clients when
the import of downloaded history archive messages has started.
2022-12-05 10:51:53 +01:00
frank 684e9654de
Allow owner/admin to delete messages of a community (#2958) 2022-12-02 19:34:02 +08:00
Pascal Precht 4d93ea83be fix: typo in message handler which I found quite annoying 2022-11-17 19:15:14 +01:00
yqrashawn 68d2d6bdfb
feat: delete message for new design (#2922) 2022-11-17 18:11:58 +08:00