Commit Graph

233 Commits

Author SHA1 Message Date
Jonathan Rainville 2bdc7ec0f4
fix(handler): fix CR received from a removed contact removed (#4708)
Fixes https://github.com/status-im/status-desktop/issues/13488

The problem was that when you add a contact, it create the chat. Then, if you remove them, it doesn't remove the chat, so `chat.Active` is true.
Now I check in that case if it's a 1x1 chat and if so, if we are contact.
2024-02-13 10:15:42 -05:00
Mikhail Rogachev 3ea2002904
Feat: Modify grants for profile showcase use (#4694)
* chore: regenerate proto binaries

* feat: remove unused grant code for community's canPost
2024-02-11 15:11:04 +03:00
Mikhail Rogachev 2350461818
feat: Dispatch profile showcase message on mutual/verified contacts change (#4678) 2024-02-09 12:36:54 +03:00
Andrea Maria Piana c49a0fc314 [Fixes: #4687] Change requestsToJoinCommunity to a map
The test was flaky because of re-receiving the message, which resulted
in multiple identical requestsToJoin being added to messengerResponse.

We should in general avoid using arrays in messengerResponse and prefer
maps for exactly this reason.
2024-02-08 11:18:53 +00:00
Mohsen 70ee70a19a
feat: implement new endpoint to set customization color (#4568) 2024-02-07 18:20:54 +03:00
Andrea Maria Piana 605fe40e32 Fix encryption metadata issues #4613
This commit fixes a few issues with communities encryption:

Key distribution was disconnected from the community description, this created a case where the key would arrive after the community description and that would result in the client thinking that it was kicked.
To overcome this, we added a message that signals the user that is kicked. Also, we distribute the key with the community description so that there's no more issues with timing.
This is a bit expensive for large communities, and it will require some further optimizations.

Key distribution is now also connected to the request to join response, so there are no timing issues.

Fixes an issue with key distribution (race condition) where the community would be modified before being compared, resulting in a comparison of two identical communities, which would result in no key being distributed. This commit only partially address the issue.
2024-02-07 10:25:41 +00:00
Patryk Osmaczko ac81c15805 fix: ignore outdated COMMUNITY_SHARD_KEY messages
This mitigates issue where community shard on client's side was not in
sync with owner's.

relates to: status-im/status-desktop#13217
2024-01-29 18:21:51 +01:00
Godfrain Jacques 5f6f7e502d
(fix/status-go) fix profile picture update/removal (#4570)
This PR fixes [9947](status-im/status-desktop#9947) and contains :

    - Commit to fix the changing of custom picture and having the change
      reflected on contact's side
    - Commit to fix the deleting of picture and having the change reflected
      on contact's side
    - Rename confusing `ImageType` to `ImageFormat`
2024-01-24 12:09:28 -08:00
Andrea Maria Piana e65760ca85 Add basic peersyncing
This commit adds basic syncing capabilities with peers if they are both
online.

It updates the work done on MVDS, but I decided to create the code in
status-go instead, since it's very tight to the application (similarly
the code that was the inspiration for mvds, bramble, is all tight
together at the database level).

I reused parts of the protobufs.

The flow is:

1) An OFFER message is sent periodically with a bunch of message-ids and
   group-ids.
2) Anyone can REQUEST some of those messages if not present in their
   database.

3) The peer will then send over those messages.

It's disabled by default, but I am planning to add a way to set up the
flags.
2024-01-23 12:46:17 +00:00
frank 81f4c86086
fix: return CustomizationColor only on db rows affected (#4593) 2024-01-19 18:26:39 +08:00
Dario Gabriel Lipicar 0d2c3cef7c feat: implement token management settings for collectibles 2024-01-18 11:46:35 -03:00
Patryk Osmaczko 2a5dc6dec0 chore: remove boilerplate check of `communities.GetByID` clients
motivated by:
https://github.com/status-im/status-go/pull/4514#discussion_r1445808116
2024-01-10 18:58:17 +01:00
Godfrain Jacques 9d8b55e3d9
This PR (status-go) fixes #12821 (#4516)
- Add album_images column to the user_messages table
- Migrate the database
2024-01-08 10:18:57 -08:00
Igor Sirotin 405d468e0e
fix: force verifiedOwner in `handleSyncInstallationCommunity` (#4405) (#4538) 2024-01-08 15:57:57 +00:00
Mikhail Rogachev 7fc3e4440f
Fix: Don't create extra mutual state messages when accepting the CR again (#4488)
* Fix: don't create extra system messages when accepting the CR again

* chore: add one more test for cr flows repeated

* chore: use deprecation.AddChatsCount in contact requests tests
2023-12-22 00:38:14 +07:00
Igor Sirotin e3ef8c649a
chore: store node requests manager (#4446) 2023-12-15 19:50:12 +00:00
Ibrahem Khalil be8568e174
Community member joins the community if he sends a request to join an… (#4321) 2023-12-09 14:46:30 +02:00
Siddarth Kumar e0bbb7e2ec
fix: send chats along with response after joining (#4416)
When an open community was created by Device A and shared with Device B and when Device B would request to join such a community, the general channel would be forever in loading state.

This happened because as part of messenger response the chatId of general channel was not sent and mobile client would not fetch that chat data.

This commit fixes that issue by sending chatId as part of messenger response right after the request to join community succeeds.
2023-12-07 21:32:37 +05:30
frank d7e7792b51
Fix/duplicate accept cr messages (#4367)
* fix: Duplicate 'Contact Added' Notifications When Pair-Device User Accepts Request

* bump version
2023-12-05 12:22:20 +08:00
Cuteivist 04873ef880
feat: token order API (#4391) 2023-12-04 11:18:05 +01:00
Igor Sirotin e32c5546e1
test: request community from storenode (#4364)
* feat: request community info from storenode test

* shutdownWaitGroup

* fix requestCommunityInfoFromMailserver timestamp roundin
2023-11-25 23:24:20 +00:00
Richard Ramos c012f94681 fix: send request on non protected topics, and add missing shard information on invite 2023-11-18 12:12:06 -04:00
Vitaly Vlasov 1794b93c16 Always set PubsubTopic in filters 2023-11-18 02:26:34 +02:00
Jonathan Rainville 2076853ce3
fix(profile_showcase): fix crash when profile showcase message is nil (#4296) (#4311)
Partly fixes https://github.com/status-im/status-desktop/issues/12695
2023-11-13 12:35:41 -05:00
Mikhail Rogachev 03c32f620f
feat: Profile showcase data sharing (#4209)
* feat: Add profile showcase messaging part with ecrypted data

* feat: Separate profile showcase categories to provide ablity to store custom data

* fix: review fixes

* feat: move profile showcase out of contact data

* fix: create index on contact id for profile tables

* chore: remove logger from link preview
2023-11-09 22:59:01 +04:00
Patryk Osmaczko f7042e4b9e refactor: extract layers in StatusMessage
Extracted:
- TransportLayer
- EncryptionLayer
- ApplicationLayer
2023-11-08 21:46:22 +01:00
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