Commit graph

207 commits

Author SHA1 Message Date
Mykhailo Prakhov eb437e9d8d
feat: kick all members after ownership change and auto-accept after sharing the address (#4187)
feat: kick all members after the ownership change and auto-accept after sharing the address
2023-10-31 15:20:40 +01:00
Mohsen 27b770c41b
fix: publish group member info (#4184) 2023-10-25 21:11:04 +03:00
Patryk Osmaczko 445135eb94 fix: ensure receivedMessage.CommunityID in chat message handler is set
This enables clients to obtain invitation's community ID even when
description processing is queued.

part of: status-im/status-desktop#12481
2023-10-25 20:10:01 +02:00
Shinnok 3805662a18
fix(messenger_communities): block messages and reactions to token gated or spectated communities (#4064)
Which specifies that if a user is not a community member & a
chat member, he can't post, react or pin messages in that chat.

Notes:
- also fix&cleanup associated failing tests.
- refactor Community.CanPost() to reflect the new requirement.
- grant code is not fully implemented and is to be removed later.

Fixes https://github.com/status-im/status-desktop/issues/11915
2023-10-25 10:26:18 -04:00
Andrea Maria Piana 23f71c1125 Fix encryption id && rekey with a single message
This commit changes the format of the encryption id to be based off 3
things:

1) The group id
2) The timestamp
3) The actual key

Previously this was solely based on the timestamp and the group id, but
this might lead to conflicts. Moreover the format of the key was an
uint32 and so it would wrap periodically.

The migration is a bit tricky, so first we cleared the cache of keys,
that's easier than migrating, and second we set the new field hash_id to
the concatenation of group_id / key_id.
This might lead on some duplication in case keys are re-received, but it
should not have an impact on the correctness of the code.

I have added 2 tests covering compatibility between old/new clients, as
this should not be a breaking change.

It also adds a new message to rekey in a single go, instead of having to
send multiple messages
2023-10-24 20:48:54 +01:00
frank 624996a7e9
only sync decisions/state of AC notifications (#3979) 2023-10-22 17:41:20 +08:00
Mykhailo Prakhov 74c13fd363
fix: setup owner as CommunityDescription signer after minting community owner token (#4168) 2023-10-19 13:03:41 +02:00
Patryk Osmaczko a9cde06e44 refactor: simplify community requests logic
With the recent introduction of pending states, the community requests
logic became more complex. This commit simplifies the flow and
appropriately delegates logic to its corresponding abstraction levels:
messenger, manager and community. Additionally, it eliminates
redundancies in notifications and request-saving mechanism.
2023-10-18 17:11:20 +02:00
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