Commit Graph

199 Commits

Author SHA1 Message Date
Jonathan Rainville c8910d69fe
feat(pairing): sync 1-1 chats and groups on pairing devices (#4102)
Fixes #3547
2023-10-17 09:24:15 -04:00
Jonathan Rainville 466dccc809
feat(backup): add 1-1 chats and group chats to backup (#4073)
* feat(backup): add 1-1 chats and group chats to backup

* add active

* add clock

* add muted
2023-10-12 17:15:05 -04:00
richΛrd ba5ed725ce
waku2: static shards (#3944)
- use protected topics for communities
- associate chats to pubsub topics and populate these depending if the chat belongs to a community or not
- mailserver functions should be aware of pubsub topics
- generate private key for pubsub topic protection when creating a community
- add shard cluster and index to communities
- setup shards for existing communities
- distribute pubsubtopic password
- fix: do not send the requests to join and cancel in the protected topic
- fix: undefined shard values for backward compatibility
- refactor: use shard message in protobuffers
2023-10-12 15:21:49 -04:00
Alexander e17a247d0f
Revert unviewed message count changes (#4101) 2023-10-12 14:27:56 +02:00
Patryk Osmaczko bb7273cf6f feat: allow for pending community request state changes
iterates: status-im/status-desktop#11842
2023-10-05 09:24:45 +02:00
Jonathan Rainville 2afe5a269d
feat: up mention count for 1-1 messages each 2 min (#4035) 2023-09-25 11:29:36 -04:00
Alexander 717e0f9ba5
Optimized counter increment logic for 1-1 chat messages (#3889)
* Optimized counter increment logic for 1-1 chat messages

* Updated

* Updated condition
2023-09-22 12:31:35 +02:00
Mykhailo Prakhov db9adb631f
feat: share requests to join and revealed addresses with privileged roles (#3951)
- share requests to join with new privileged roles during reevaluating member role
- share requests to join with new members, joined the community as TOKEN_MASTER, ADMIN
- share requests to join revealed addresses to ADMINS and TOKEN_MASTERS
- refactor common test functionality to make them more predictable
- removed unused CommunityToken protobuf
2023-09-20 10:37:46 +02:00
Boris Melnik 5e8300d6a1
fix(archives): Skip importing the archives for community when user not a member (#4006) 2023-09-15 10:42:28 +03:00
Sale Djenic 6894295ac3 feat: register and maintain keycard local pairing file by `status-go`
Closes: #4003
2023-09-13 17:15:32 +02:00
Sale Djenic c5fd1ee2c4 fix: converting profile to/from keycard/regular keypair handling 2023-09-07 13:02:25 +02:00
Igor Sirotin 5422b867f3
Hotfix: mark `Chat` and `Pin` archive messages as seen (#3992) (#3999) 2023-09-07 13:33:20 +03:00
Ibrahem Khalil 22ec4ac586
Link previews not working on message edit (#3974) 2023-08-31 10:21:25 +03:00
Sale Djenic fbcda780ec feat: handling migrating non profile keycard keypair to app on paired device 2023-08-30 10:17:19 +02:00
Sale Djenic 57dea7b08d fix: saving/updating a keycard updates the accounts' operability
This commit skips deleting a keystore file for account which are not marked as fully operable
and also skips deleting master key keystore file if a keypair is non operable. It also takes into
consideration the operable property of an account when adding/updating/handling a keypair/keycard.

u3
2023-08-30 10:17:19 +02:00
Andrea Maria Piana 4b9517c0e2 Handle remove event out of order in private group chats
When we received a remove event from a private group chat out of order,
the chat would not be created.
This was causing some issues if later on we received the previous event.
This commit changes the behavior so that a chat is created.
2023-08-29 17:26:09 +01:00
Sale Djenic abe43a83ae feat: added an activity center notification that a new keypair was added on a paired device 2023-08-25 11:59:28 +02:00
Sale Djenic e732000d31 fix: remove account if it's marked as removed in received `protobuf.SyncKeypair` message
When we switched to marking removed accounts, the handler remained unchanged. It kept
checking for the account existence in the received `protobuf.SyncKeypair` message, instead
of checking a removed flag.
2023-08-23 14:07:39 +02:00
Andrea Maria Piana 8dd1b66d69 Always use protobufs by reference & generate handlers 2023-08-22 12:08:54 +01:00
Mykhailo Prakhov 7eac9b170c
feat: community privileged user sync message (#3879) 2023-08-15 17:27:01 +02:00
flexsurfer 1ca165c586
Add preview and counters for CR system messages #16898 (#3872) 2023-08-11 19:08:54 +02:00
Andrea Maria Piana abcab237fa
Revert "Optimized counter increment logic for 1-1 chat messages (#3845)"
This reverts commit e762cf4b9e.
2023-08-11 13:18:42 +01:00
Alexander e762cf4b9e
Optimized counter increment logic for 1-1 chat messages (#3845)
* Optimized counter increment logic for 1-1 chat messages

* Fix

* Style fix

* Bugfix
2023-08-11 12:15:57 +02:00
Sale Djenic 6ee7038809 fix: synced from field updated if recovered keypairs made fully operable 2023-08-10 16:09:29 +02:00
Sale Djenic 2325bc5565 fix: accounts should keep the origin operability when local pairing 2023-08-10 16:09:29 +02:00
Pascal Precht 248e4a7f24 refactor: EventSenders forward RequestToJoin decision to control node
This is a bigger change in how community membership requests are handled
among admins, token masters, owners, and control nodes.

Prior to this commit, all privileged users, also known as
`EventSenders`, were able to accept and reject community membership
requests and those changes would be applied by all users.

This commit changes this behaviour such that:

1. EventSenders can make a decision (accept, reject), but merely forward
   their decision to the control node, which ultimately has to confirm
   it
2. EventSenders are no longer removing or adding members to and from
   communities
3. When an eventsender signaled a decision, the membership request will
   enter a pending state (acceptedPending or rejectedPending)
4. Once a decision was made by one eventsender, no other eventsender can
   override that decision

This implementation is covered with a bunch of tests:

- Ensure that decision made by event sender is shared with other event
  senders
  - `testAcceptMemberRequestToJoinResponseSharedWithOtherEventSenders()`
  - `testRejectMemberRequestToJoinResponseSharedWithOtherEventSenders()`
- Ensure memebrship request stays pending, until control node has
  confirmed decision by event senders
  - `testAcceptMemberRequestToJoinNotConfirmedByControlNode()`
  - `testRejectMemberRequestToJoinNotConfirmedByControlNode()`
- Ensure that decision made by event sender cannot be overriden by other
  event senders
  - `testEventSenderCannotOverrideRequestToJoinState()`

These test cases live in three test suites for different event sender
types respectively

- `OwnerWithoutCommunityKeyCommunityEventsSuite`
- `TokenMasterCommunityEventsSuite`
- `AdminCommunityEventsSuite`

In addition to the changes mentioned above, there's also a smaller
changes that ensures membership requests to *not* attached revealed wallet
addresses when the requests are sent to event senders (in addition to
control nodes).

Requests send to a control node will still include revealed addresses as
the control node needs them to verify token permissions.

This commit does not yet handle the case of event senders attempting to
kick and ban members.

Similar to accepting and rejecting membership requests, kicking and
banning need a new pending state. However, we don't track such state in
local databases yet so those two cases will be handled in future commit
to not have this commit grow larger.
2023-08-08 14:46:03 +02:00
Patryk Osmaczko ce82a8c0e5 chore: remove community invitations 2023-08-05 11:49:00 +02:00
Igor Sirotin bbb8e99492
Fix syncing `blocked` contacts (#3799)
* fix(messenger_testing_utils): Always return response
* feat: test blocking/unblocking contacts with paired devices 
* fix: Remove recursive sync on contact blocking
* rename `syncing` flag to `fromSyncing`
2023-08-04 13:41:24 +03:00
Patryk Osmaczko 9eaf229161 refactor: improve community functions naming 2023-08-02 19:59:16 +02:00
Sale Djenic 0ae7aa44f0 feat: `deleteKeystoreFilesForKeypair` function added 2023-08-01 13:26:10 +02:00
Anthony Laibe 1df8c1c511 feat: save preferred networks 2023-07-31 22:50:02 +02:00
Mykhailo Prakhov 89253ac684
fix: owner without community private key and token master was not able send all admin events (#3819) 2023-07-28 20:18:27 +02:00
Sale Djenic 4088edfa14 fix: changes needed to support recovering from waku in case recovering is done using keycard, but stored data refers to a regular profile and vice versa 2023-07-28 12:16:23 +02:00
Sale Djenic d5bba5d80f chore: wallet accounts improvements - soft delete 2023-07-25 18:11:05 +02:00
Patryk Osmaczko f1db6d1615 fix: remove redundancy in permissions check when handling request to join
- Fixed redundant permissions check. If community is set to auto-accept,
  then permissions would be checked twice, in
`HandleCommunityRequestToJoin` and `AcceptRequestToJoinCommunity`.
Mitigated it by returning from `HandleCommunityRequestToJoin` immediately
in case of auto-accept.

- Extracted `accountsSatisfyPermissionsToJoin` to remove code
  duplication and simplify the logic.
2023-07-21 20:41:34 +02:00
Sale Djenic 42d5d36cf5 fix: fixed accounts positions in case of account deletion 2023-07-20 14:32:41 +02:00
Sale Djenic 543b087896 fix: wallet accounts ordering improvements 2023-07-20 14:32:41 +02:00
frank 71ca35bf34
Feat/sync customization color (#3702)
* sync customization color

* addressed feedback from @cammellos

* add param customizationColorClock to function generateOrImportAccount
2023-07-18 21:35:06 +08:00
Mikhail Rogachev 1f3a860867
fix: ignore contact requests from mutual and dismissed contacts (#3754)
https://github.com/status-im/status-desktop/issues/11483
2023-07-14 17:37:38 +04:00
Mikhail Rogachev 8bcc493477
Fix: mutual state messages behaviour (#3640)
* feat: don't remove sent mutual state messages on accepting a CR

* fix: don't send mutual state message for a new contact

* chore: move mutual state messages to `addContact`

* fix: use one chat for mutual state messages and contact requests

* fix: change `added` mutual state updatede messages to `accepted`

* feat: Use different content type for each mutual state event system message

* chore: use constants for mutual event system messages test, review fixes

* chore: fix tests related to local contacts map
2023-07-12 11:12:58 -04:00
Igor Sirotin 244b4273de
fix: don't store ourselves as a contact (#3627) 2023-07-12 12:46:56 +03:00
Sale Djenic 7063ad11aa chore: synchronization improvements applied to keycards
This is the second step of improvements over keypairs/keycards/accounts.
- `SyncKeycardAction` protobuf removed
- `SyncKeypair` protobuf is used for syncing keycards state as well as for all
keycards related changes
- `last_update_clock` column removed from `keypairs` table cause as well as
for accounts, any keycard related change is actually a change made on a related
keypair, thus a keypair's clock keeps the clock of the last change
- `position` column added to `keypairs` table, needed to display keycards in
the same order accross devices
2023-07-11 15:14:49 +02:00
Jonathan Rainville 2c275058ad
feat(community): add api to edit shared address (#3723) 2023-07-10 10:11:37 -04:00
Patryk Osmaczko cd1ba1abaa refactor: remove unused parameter from `handleArchiveMessages` 2023-07-07 11:17:14 +02:00
Sale Djenic 61527f8c78 chore: synchronization improvements applied to keypairs/accounts
This is the first step of improvements over keypairs/keycards/accounts.
- `SyncKeypairFull` protobuf removed
- `SyncKeypair` protobuf is used for syncing all but the watch only accounts
- `SyncAccount` is used only for syncing watch only accounts
- related keycards are synced together with a keypair
- on any keypair change (either it's just a keypair name or any change made over an
account which belongs to that keypair) entire keypair is synced including related keycards
- on any watch only account related change, that account is synced with all its details
2023-07-05 14:41:26 +02:00
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