Commit Graph

154 Commits

Author SHA1 Message Date
Mykhailo Prakhov e058b50a2e
feat: community admin permission functionality (#3569)
* feat: community admin implementation

* fix: code review fixes

* chore: request admin permissions in CheckPermissionToJoin, unit test fix
2023-06-14 10:15:46 -04:00
frank b6d4e75cf1
Feat/sync activity center notification (#3535)
fix flaky test: TestRetrieveBlockedContact

resolve conflict when rebase origin/develop

Feat/sync activity center notification (#3581)

* feat: sync activity center notification

* add test

* fix lint issue

* fix failed test

* addressed feedback from sale

* fix failed test

* addressed feedback from ilmotta

go generate ./protocol/migrations/sqlite/...

feat: add updated_at for syncing activity center notification
2023-06-10 10:00:17 +08:00
Mikhail Rogachev 8589a525a5
Add system message for mutual contact state updates (#3519)
* feat: add mutual state update system message

* feat: send mutual state update on accepting CR

* feat: send mutual state update when removing a contact

* fix: don't send MutualStateUpdateMessage over wire

* fix: mutual state update message text fixed

* fix: new clock to ensure system message after CR and add chat to the response

* feat: add AC notification for contact removal

* feat: replace "sent" mutual state system message with "added"
2023-06-08 16:00:19 +04:00
Patryk Osmaczko 46768e624a feat: add and populate IdentityImage::LocalURL
part of: status-im/status-desktop#10886
2023-06-07 22:32:50 +02:00
Sale Djenic cff7d2f693 fix: profile social links updated 2023-06-06 09:59:12 +02:00
Sale Djenic c6192bd26c fix: issues caused by wrong `pairing.proto` fixed 2023-06-05 09:29:34 +02:00
Khushboo-dev-cpp 8b91e3aaaf
chore: Add ColorId for Wallet accounts that can be shared with mobile (#3521) 2023-06-02 17:06:51 +02:00
Jonathan Rainville b68853c53e
fix(messenger_handler): fix group chat not being set as active (#3545)
Fixes an issue where if a group chat was first received from a non-contact, and later received from a contact, it still wouldn't save it as active.

That's because we checked if we were **newly** added instead of just if we were added. That meant that in the case I described above, the chat would then never have the chance to be set active.
2023-05-30 09:49:46 -04:00
Jonathan Rainville a6285cc827
Fix chats reseting when a Sync signal comes for communities (#3539)
* fix(community): stop re-joining comm when receiving a sync community msg

Fixes an issue with chats being reset. Since joining a community resaves the chats with the synced default value, it resets the sate of the chats, losing the unread messages, the muted state and more.
The solution is to block the re-joining of the community. In the case of the sync, we catch that error and just continue on.

* fix(import): fix HandleImport not saving the chat

Doesn't change much, but it could have caused issues in the future, so since we might have modified the chat, we make sure to save them
Also adds a test

* fix tests
2023-05-29 13:57:05 -04:00
Roman Volosovskyi aded83fc6e
Fix panic on receiving nil message at handleSyncKeypair 2023-05-26 18:43:44 +02:00
Sale Djenic eeaaf0ce3f feat: accounts improvements applied
- old `accounts` table is moved/mapped to `keypairs` and `keypairs_accounts`
- `keycards` table has foreign key which refers to `keypairs.key_uid`
- `Keypair` introduced as a new type
- api endpoints updated according to this change
2023-05-25 19:46:47 +02:00
Mikhail Rogachev 8c90353bc0
fix: create a CR on contact sync with received CR state (#3495)
* fix: create a CR on contact sync with received CR state

* fix: create a CR on contact sync with sent CR state

* Review fixes

* Fix: ignore own contact installation or syncing
2023-05-22 16:22:33 +04:00
Jonathan Rainville 9151aa7f04
fix(unviewed): fix edge case where unviewed count would be -1 (#3491) (#3496) 2023-05-16 12:11:52 -04:00
Jonathan Rainville 34127cd14f
fix(messenger_handler): fix checkForDeletes logic with images (#3477) (#3488) 2023-05-16 11:00:49 -04:00
frank 0197e6c484
Feat/sync local deleted message (#3476)
* sync local deleted messages

* rebase

* add REPLACE

* fix lint

* defer rows.Close() / rename function

* add local pair test

* replace unused clock with _
2023-05-12 16:31:34 +08:00
Patryk Osmaczko fd05016c6e fix: mark imported messages as seen
fixes: status-im/status-desktop#10600
2023-05-10 18:51:48 +02:00
frank 98d3b4198b
sync message for `delete for me` should not be sent to someone else (#3462)
* sync message for `delete for me` should not be sent to someone else

* addressed feedback from review

* remove LocalChatID

* bump version
2023-05-09 20:54:56 +08:00
Volodymyr Kozieiev a669e7d038
More fields added to ChatPreview. LastMessage now can be a deleted message (#3397) 2023-05-08 18:02:54 +01:00
Igor Sirotin 44ded4dd64
fix(Messenger): Count SystemMessagePinnedMessage as unviewed (#3449) 2023-05-05 18:26:19 +03:00
Jonathan Rainville 79cbe6a410
fix(mentions): deleting or editing a mention should remove the mention (#3421)
* fix(mentions): deleting or editing a mention should remove the mention

* test(edit): add a test for mentions in edits

* test(delete): add test for deleting a message with a mention
2023-04-27 10:22:26 -04:00
Boris Melnik 2950d37e43
feat(edit-message): Edit image messages (#3393)
* feat(edit-message): Edit image messages

* feat(edit-message): Adds tests for edit image messages text

* chore(messenger_messages): Replace ErrChatNotFound duplications
2023-04-26 14:10:17 +03:00
Andrea Maria Piana 7650f3003e Fix some issues with pinned messages
There were a couple of issues on how we handle pinned messages:

1) Clock of the message was only checked when saving, meaning that the
   client would receive potentially updates that were not to be
   processed.
2) We relied on the client to generate a notification for a pinned
   message by sending a normal message through the wire. This PR changes
   the behavior so that the notification is generated locally, either on
   response to a network event or client event.
3) When deleting a message, we pull all the replies/pinned notifications
   and send them over to the client so they know that those messages
   needs updating.
2023-04-25 16:02:48 +01:00
Mikhail Rogachev 96532f97c4
Unifying the endpoints for contact flows (#3379)
* fix: Contact requests flows

fix: pending CR notification
fix: use CR as message with provided text

* fix: Remove legacy default contact request

* fix: Add test case sending CR after removal from contacts

* fix: refactor contact request tests to have common steps

* fix: activate chat on sender side after receiveing the CR

* chore: Return defaultContactRequestID function

* fix: force activate chat on reciever's side

* fix: ensure AC notification's name for CR notifiaction match contact's primary name
2023-04-25 15:27:15 +04:00
Sale Djenic e4f23752a9 fix: removing exceptions for syncing/backing up accounts in case of mobile app 2023-04-21 16:35:24 +02:00
Sale Djenic f1e3ae5b46 feat: sync and backup wallet accounts
Changes applied here introduce:
- improvements to sync wallet accounts among devices (including all account types)
- backing up wallet accounts to and fetch them from waku (an information about received
wallet accounts is sent via `waku.backedup.wallet-account` signal to a client)
2023-04-21 16:35:24 +02:00
Mohamed Javid 0eff61c57a
Community request to join changes for pending and declined states (#3387)
* Community request to join changes

* Fix read state for request to join notification

* Bring back deleted notification when updated with response

* Update Request timeout to 7 days

* Update VERSION
2023-04-21 14:48:47 +05:30
Ibrahem Khalil 719af90fcc
Add muted_till param for chats (#3258) 2023-04-16 17:06:00 +02:00
Jonathan Rainville 62da2d404c
fix(image-album): make sure to delete all images part of an album (#3380)
* fix(image-album): make sure to delete all images part of an album

* test(delete): add test that deletes a message part of an album

* test(delete): add test where the signal to delete images is after

also adds the handling of deleteForMe

* fix(delete): add album deletion handling for deleteForMe
2023-04-14 13:17:56 -04:00
Mikhail Rogachev 302437e32e
fix: Move ActivityCenterNotificationTypeCommunityKicked to the right place (#3390) 2023-04-14 13:02:28 +04:00
frank 5fd9e93e9c
backup/sync if seed phrase removed (#3385) (#3384)
backup/sync bio
2023-04-13 08:45:25 +08:00
Mohamed Javid e131d738bd
[Fix] Remove AC request notification on community request cancellation (#3381) 2023-04-06 19:36:24 +05:30
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