212 Commits

Author SHA1 Message Date
Samuel Hawksby-Robinson
26b33aa09d Added AccountType to enforce strict typing on Accounts
Also a tpyo was fixed, probably introduced by me.
2022-08-25 22:01:43 +01:00
Pascal Precht
3f987cc565 fix(messenger): don't remove inactive chats when syncing
This commit ensures we're relying on `chat.DeletedAtClockValue` instead
of `chat.Active` to know whether or not we need to remove the chat from
paired devices.

Because we were relying on `Active != true`, we ended up with a serious
but that would result in deactivating all chats on paired devices.

The reason the chats would disappear on paired devices is because, when
setting up a new device by importing a seedphrase, chances are this
device will receive `HandleBackUp` signals (which original from other
devices with the same account that backed up contacts etc).

When backups are handled, we create chats for every contact that's part
of the backup signal. Those chats are set to `Active = false` because
the signal handling shouldn't cause those chats to show up in the UI.

However, because those are set to `Active = false`, the next time the
user tries to sync from this devices, all those chats are considered as
"removed", hence sending "chat removed" signals when syncing (which then
causes those chats to disappear on all paired devices.

We need to rely on `DeletedAtClockValue` to know whether a chat was
indeed removed and only then emit such a signal.
2022-08-25 11:51:01 +02:00
Roman Volosovskyi
f43f43cc30
[#13672] Sync contact request decision 2022-08-24 16:08:41 +02:00
Samuel Hawksby-Robinson
344458d74a Added multiaccounts.Database tests for new funcs 2022-08-22 13:27:59 +01:00
Patryk Osmaczko
78d4d86f68 chore: add bio and social links validation 2022-08-16 14:29:00 +02:00
Patryk Osmaczko
b711b61fb9 feat: add bio
closes: #2782
2022-08-16 14:29:00 +02:00
Patryk Osmaczko
4143de3816 feat: add social links
iterates: #2782
2022-08-16 14:29:00 +02:00
Roman Volosovskyi
0135cc155b
[#13647] Avoid rewriting of response.Settings on new acc sync 2022-08-03 12:12:53 +02:00
530f3c7a3a
rename status-react to status-mobile
Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-07-17 15:37:14 +02:00
Pascal Precht
f6c9ec7838 refactor: Require request access for all communities
This commit introduces a few changes regarding users accessing
communities:

While the APIs still exist, community invites should no longer be
used, instead communities should merely be "shared".
Sharing a community to users allows users to "join" the community,
which in reality makes them request access to that community.
This means, users have to request access to any community, even if
the community has permissions set to NO_MEMBERSHIP
Only difference between ON_REQUEST and NO_MEMBERSHIP is that
ON_REQUEST communities require manual approval of the owner/admin
to access a community. NO_MEMBERSHIP communities accept
automatically (as soon as owner/admin receives the request).
This also implies that users are no longer optimistically added to the
member list of communities, but only after they have been accepted.

This introduces a bit of a message ping-pong for users to know that
someone is now part of a community
2022-07-08 13:16:12 +02:00
Vitaliy Vlasov
3dee94e505 Wallet sync for generated accounts 2022-07-06 19:24:43 +03:00
Richard Ramos
0322ac497b
feat: contact verification request (#2586)
fix: add verification request to response

fix: code review

add missing functions and simplify timestamp usage

fix: sync verification requests

feat: add endpoint to fetch all received verification requests

feat: add signal when trusting verification request

Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2022-07-05 15:49:44 -04:00
Richard Ramos
31feea9f15
fix: missing display name when requesting to join a community (#2725) 2022-06-22 14:02:44 -04:00
flexsurfer
1c77f2ed6e
fix offline messages marked as seen (#2713) 2022-06-21 18:31:15 +02:00
Andrea Maria Piana
22669d0423 Add default contact request
If a contact update or a legacy contact request is sent, we create a
notification for the user in the activity center so it can be replied
to.
If at a later date a new contact request is received from the same user,
this will replace it, so the proper message can be displayed.
2022-06-20 10:44:08 +01:00
Andrea Maria Piana
f9ac629b2a Enable contact request settings 2022-06-13 13:46:45 +01:00
Patryk Osmaczko
5df5d6b519 feat: remove explicit group chat join
relates: #status-im/status-desktop/5717
2022-06-08 11:48:45 +01:00
Andrea Maria Piana
1bfde4c4cc Initial support for mutual contact requests 2022-05-31 09:12:36 +01:00
Vitaliy Vlasov
011238b1d1 Wallet sync 2022-05-18 15:25:20 +03:00
Pascal Precht
714c03c635 feat: introduce CommunityAdminSettings in CommunityDescription
This allows to store community admin settings that are meant to be propagated
to community members (as opposed to the already existing
`CommunitySettings` which are considered local to every account).

The first setting introduced as part of this commit is one that enables
community admins to configure whether or not members of the community
are allowed to pin messages in community channels.

Prior to this commit, this was not restricted at all on the protocol
level and only enforced by clients via UI (e.g. members don't see an
option to pin messages, although they could).

This config setting now ensures that:

1. If turned off, members cannot send a pin message
2. If turned off, pin messages from members are not handled/processed

This is needed by https://github.com/status-im/status-desktop/issues/5662
2022-05-18 09:58:11 +02:00
Pascal Precht
43d6305157 Handle history archive magnetlink messages
This introduces the ability for status notes to handle community
history archive magnetlinks. To make this work, a few things are needed:

1. A new database table has been introduced to store message archive
   hashes. This is necessary so status nodes can determine whether or
   not they need to download a certain archive
2. The messenger's `handleRetrievedMessages()` has been exteded to take
   magnetlink messages into account
3. New APIs were added to download torrent data given a magnetlink and
   also to extract messages from downloaded archives, which are then
   later fed to `handleRetrievedMessages`

Closes #2568
2022-05-10 11:27:31 +02:00
Vitaliy Vlasov
16197dc807 Sync profile picture 2022-04-21 19:50:31 +03:00
Roman Volosovskyi
9de4eb3c8a
Backup deleted communities 2022-04-14 18:01:07 +02:00
Samuel Hawksby-Robinson
e67592d556
Sync Settings (#2478)
* Sync Settings

* Added valueHandlers and Database singleton

Some issues remain, need a way to comparing incoming sql.DB to check if the connection is to a different file or not. Maybe make singleton instance per filename

* Added functionality to check the sqlite filename

* Refactor of Database.SaveSyncSettings to be used as a handler

* Implemented inteface for setting sync protobuf factories

* Refactored and completed adhoc send setting sync

* Tidying up

* Immutability refactor

* Refactor settings into dedicated package

* Breakout structs

* Tidy up

* Refactor of bulk settings sync

* Bug fixes

* Addressing feedback

* Fix code dropped during rebase

* Fix for db closed

* Fix for node config related crashes

* Provisional fix for type assertion - issue 2

* Adding robust type assertion checks

* Partial fix for null literal db storage and json encoding

* Fix for passively handling nil sql.DB, and checking if elem has len and if len is 0

* Added test for preferred name behaviour

* Adding saved sync settings to MessengerResponse

* Completed granular initial sync and clock from network on save

* add Settings to isEmpty

* Refactor of protobufs, partially done

* Added syncSetting receiver handling, some bug fixes

* Fix for sticker packs

* Implement inactive flag on sync protobuf factory

* Refactor of types and structs

* Added SettingField.CanSync functionality

* Addressing rebase artifact

* Refactor of Setting SELECT queries

* Refactor of string return queries

* VERSION bump and migration index bump

* Deactiveate Sync Settings

* Deactiveated preferred_name and send_status_updates

Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2022-03-23 18:47:00 +00:00
Andrea Maria Piana
f0d3e0419d Backup communities 2022-03-23 14:45:52 +00:00
Richard Ramos
50ec6f97e0 feat: display name 2022-03-14 13:48:34 -04:00
Roman Volosovskyi
36b4ecabbf
Set joined=message.clock on syncing pubchat creation 2021-12-24 16:47:28 +02:00
Michele Balistreri
9feea4fe25
dont sync chats with pending notifications (#2458)
* dont sync chats with pending notifications
* set accepted/dismissed notifications as read
* activate chat if message is sent from us
2021-12-07 17:34:43 +03:00
Parvesh Monu
83c3849899
Decline pending group invites from user, when user is blocked (#2455) 2021-12-06 18:14:40 +05:30
Parvesh Monu
a65c873b8f
Decline pending group invitations from user, when user is banned (#2437) 2021-11-25 20:51:42 +05:30
Parvesh Monu
478eb435b1
Allow user to be re-invited to the same group after leaving (#2431)
Co-authored-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2021-11-19 20:02:04 +05:30
Andrea Maria Piana
6724cf4c75 Block contact endpoint 2021-11-15 18:53:35 +00:00
Andrea Maria Piana
a7b0c6c933 Backup removed & added by them contacts 2021-11-15 18:53:35 +00:00
Andrea Maria Piana
301325a22e Add backing up of contacts
We periodically check whether we should backup contacts through waku.

Currently it's not tied to any event, it will only schedule a backup on
a tick, or through the provided API endpoint.
2021-11-15 18:53:35 +00:00
Roman Volosovskyi
4a0ad1cf69
[pairing] Sync read messages 2021-11-02 10:02:27 +02:00
Parvesh Monu
c20e8ebdef
Store Highlight field for identify new chats (#2384) 2021-10-21 22:34:56 +05:30
Andrea Maria Piana
23308d7e8c Allow profile pictures from contacts 2021-10-12 16:39:29 +01:00
Brian Sztamfater
4d3c04e41c
Modify CanonicalImage function to return large or thumb image if available (#2300) 2021-10-07 01:42:27 -03:00
Roman Volosovskyi
4de912baba [pairing] Sync chat removing 2021-10-06 12:38:57 +01:00
Andrea Maria Piana
5e83d8e95e Add HasAddedUs field 2021-10-04 12:19:15 +02:00
Andrea Maria Piana
438c2e8883 contacts performance 2021-10-04 12:19:15 +02:00
Samuel Hawksby-Robinson
d9ea6a910e Tests and linting 2021-09-30 13:02:41 +01:00
Samuel Hawksby-Robinson
3a1349141a Refactor so both Messenger and MessageHandler could use code from a shsared source 2021-09-30 13:02:41 +01:00
Brian Sztamfater
d65494d1f8
Send notification when your contact invites you to group chat (#2361) 2021-09-27 11:02:25 -03:00
Roman Volosovskyi
181c06722f
Mark own messages as seen 2021-09-27 12:42:07 +03:00
Roman Volosovskyi
5793470fad
[pairing] Fetch history on receiving pubchat installation. 2021-09-27 11:56:29 +03:00
Andrea Maria Piana
bd314b8adc Fix timeline/profile updates messages 2021-09-24 10:01:40 +01:00
Roman Volosovskyi
839d6b3194
[status-im/status-react#12517] Ensure that all necessary contact fields are synced 2021-09-23 12:22:49 +03:00
Andrea Maria Piana
bd1e6b0033 Fix handling on public chat messages 2021-09-15 09:28:51 +01:00
Samuel Hawksby-Robinson
07e46714f0
Anon Metrics Broadcast (#2198)
* Protobufs and adapters

* Added basic anon metric service and config init

* Added fibonacci interval incrementer

* Added basic Client.Start func and integrated interval incrementer

* Added new processed field to app metrics table

* Added id column to app metrics table

* Added migration clean up

* Added appmetrics GetUnprocessed and SetToProcessedByIDs and tests

There was a wierd bug where metrics in the db that did not explicitly insert a  value would be NULL, so could not be found by . In addition I've added a new primary id field to the app_metrics table so that updates could be done against very specific metric rows.

* Updated adaptors and db to handle proto_id

I need a way to distinguish individual metric items from each other so that I can ignore the ones that have been seen before.

* Moved incrementer into dedicated file

* Resolve incrementer test fail

* Finalised the main loop functionality

* Implemented delete loop framework

* Updated adaptors file name

* Added delete loop delay and quit, and tweak on RawMessage gen

* Completed delete loop logic

* Added DBLock to prevent deletion during mainLoop

* Added postgres DB connection, integrated into anonmetrics.Server

* Removed proto_id from SQL migration and model

* Integrated postgres with Server and updated adaptors

* Function name update

* Added sample config files for client and server

* Fixes and testing for low level e2e

* make generate

* Fix lint

* Fix for receiving an anonMetricBatch not in server mode

* Postgres test fixes

* Tidy up, make vendor and make generate

* delinting

* Fixing database tests

* Attempted fix of does:  cannot open `does' (No such file or directory)
not:   cannot open `not' (No such file or directory)
exist: cannot open `exist' (No such file or directory) error on sql resource loas

* Moved all anon metric postgres migration logic and sources into a the protocol/anonmetrics package or sub packages. I don't know if this will fix the does:  cannot open `does' (No such file or directory)
not:   cannot open `not' (No such file or directory)
exist: cannot open `exist' (No such file or directory) error that happens in Jenkins but this could work

* Lint for the lint god

* Why doesn't the linter list all its problems at once?

* test tweaks

* Fix for wakuV2 change

* DB reset change

* Fix for postgres db migrations fails

* More robust implementation of postgres test setup and teardown

* Added block for anon metrics functionality

* Version Bump to 0.84.0

* Added test to check anon metrics broadcast is deactivated

* Protobufs and adapters

* Added basic anon metric service and config init

* Added new processed field to app metrics table

* Added id column to app metrics table

* Added migration clean up

* Added appmetrics GetUnprocessed and SetToProcessedByIDs and tests

There was a wierd bug where metrics in the db that did not explicitly insert a  value would be NULL, so could not be found by . In addition I've added a new primary id field to the app_metrics table so that updates could be done against very specific metric rows.

* Updated adaptors and db to handle proto_id

I need a way to distinguish individual metric items from each other so that I can ignore the ones that have been seen before.

* Added postgres DB connection, integrated into anonmetrics.Server

* Removed proto_id from SQL migration and model

* Integrated postgres with Server and updated adaptors

* Added sample config files for client and server

* Fix lint

* Fix for receiving an anonMetricBatch not in server mode

* Postgres test fixes

* Tidy up, make vendor and make generate

* Moved all anon metric postgres migration logic and sources into a the protocol/anonmetrics package or sub packages. I don't know if this will fix the does:  cannot open `does' (No such file or directory)
not:   cannot open `not' (No such file or directory)
exist: cannot open `exist' (No such file or directory) error that happens in Jenkins but this could work
2021-09-01 13:02:18 +01:00