1140 Commits

Author SHA1 Message Date
Andrea Maria Piana
14f4c40404 Split Merge into functions 2020-12-03 18:25:53 +01:00
Andrea Maria Piana
156c0de832 Add SendChatMessages endpoints
This commit adds an endpoint to batch the sending of messages.
This is useful to simplify client logic when sending a batch of messages
and ensuring the correct order in the message stream.

It currently implements only what's needed, and naively return an error
if any of the messages fail.
2020-12-03 18:25:53 +01:00
Andrea Maria Piana
938e0d77dd Don't return an error on datasync Send
if an error is returned on the Send function, datasync will keep
  retrying a message at each epoch. If the message cannot be sent (for
  example is too large), then no messages will be sent until logout.
2020-11-26 16:25:52 +01:00
Andrea Maria Piana
0c79e50ca8 Remove unnecessary logs & fix flaky test 2020-11-26 16:25:52 +01:00
Andrea Maria Piana
6ad047d56f Fix datasync retry
This commit fixes a bug on the mvds library where the nextEpoch would be
incorrectly summed to the retry time, resulting in messages not being
retried, or retried much less frequently the longer the app was running.
It also updates the retry timing to backoff exponentially at multiple of
30 seconds.
2020-11-26 16:25:52 +01:00
Jonathan Rainville
b2d8f7f416
feat: add bookmarks table for the browser bookmarks
plus get bookmark icon using a lib
2020-11-16 13:31:34 -05:00
flexsurfer
e8dbc66227
timeline reactions (#2079) 2020-11-16 12:54:39 +01:00
Roman Volosovskyi
4026841dc1
Add New flag to a received message
This change allows to count unviewed messages properly on the client
side when replied message is attached to reply before being passed.
2020-11-10 18:02:38 +02:00
Andrea Maria Piana
f10e70ce96 Incerase verified count when ENS name does not verify
In some cases no error is returned but the name is not verified.
Before this ENS names would get verified again every 30s.
This commit changes the logic so that if they fail to verify without
error they will still exponentially backoff.
2020-11-10 08:11:39 +01:00
Roman Volosovskyi
d20cf2583f
Revert "Allow receiving old messages after rejoining a pubchat"
This reverts commit fa136ebaa7edd1ff9bdd180cfc441162c285ad72.
2020-11-06 17:09:49 +02:00
andrey
40e2fc7526 fix timeline 2020-11-06 12:31:14 +01:00
Andrea Maria Piana
8966d81199 linting 2020-11-06 06:35:35 +01:00
andrey
6f207def2b timeline 2020-11-06 06:35:35 +01:00
Roman Volosovskyi
fa136ebaa7
Allow receiving old messages after rejoining a pubchat 2020-11-05 15:13:38 +02:00
Andrea Maria Piana
75e0809f50 Split datasync messages in batches
When sending messages in quick succession, it might be that multiple
messages are batched together in datasync, resulting in a single large
payload.
This commit changes the behavior so that we can pass a max-message-size
and we split the message in batches before sending.

A more elegant way would be to split at the transport layer (i.e
waku/whisper), but that would be incompatible with older client.

We can still do that eventually to support larger messages.
2020-11-05 12:45:29 +01:00
Volodymyr Kozieiev
9dffff042e Don't send new members event when there are no new members 2020-11-02 17:05:56 +01:00
Volodymyr Kozieiev
3e446eed8c
Link previews support (#2059) 2020-10-27 19:35:28 +02:00
andrey
b388002771 profile status updates 2020-10-27 14:56:35 +01:00
Andrea Maria Piana
5cea355541 Use in memory database for messenger tests 2020-10-14 08:37:23 +02:00
Andrea Maria Piana
b11399ffc6 Use ErrRecordNotFound instead of sql.ErrNoRows
We were checking for the wrong error kind when pulling messages from the
database, which resulted in the code not retrying to pull the message,
giving flaky tests / race condition (that's present in production as
well)
2020-10-08 13:23:00 +02:00
Andrea Maria Piana
896f5c24bf Force migration if dirty 2020-10-01 13:47:59 +02:00
Andrea Maria Piana
200273aa0e Count runes and not characters 2020-09-25 14:02:09 +02:00
Andrea Maria Piana
a759d9dd67 Fix push notification & mentions
The code had an issue where it would not register a chat if just joined
as re-register push notifications was called before the chat had been
added.
This commit fixes the behavior by making sure that the chat just joined
is included.
2020-09-17 07:35:18 +02:00
Andrea Maria Piana
61b345ff33 Add index on seen & hide long messages
This commit does two things:
1) Add an index on seen & update only the not-seen messages in the query
2) Hide long messages in the database, as that's likely spam
2020-09-10 10:26:59 +02:00
Andrea Maria Piana
3c6b741f71
Add tests for send notification & review feedback 2020-09-09 21:22:34 +02:00
Andrea Maria Piana
28e06daf6d
Dont sent messages to user who have not joined 2020-09-09 21:22:18 +02:00
Andrea Maria Piana
2d525f9503
Set block mentions 2020-09-09 21:22:17 +02:00
Andrea Maria Piana
4e18d21129
Re-register on adding or removing a chat 2020-09-09 21:22:16 +02:00
Andrea Maria Piana
0d998e1858
Show correct text in case of mentions 2020-09-09 21:22:15 +02:00
Andrea Maria Piana
18877cae6f
Handle mentions on server 2020-09-09 21:22:14 +02:00
Andrea Maria Piana
8ee3c75510
Support for basic push notification for mentions 2020-09-09 21:22:13 +02:00
Andrea Maria Piana
00c5b60d7f
Move message to common namespace 2020-09-09 21:22:12 +02:00
Andrea Maria Piana
7d5d413222
Add parsing and storing of mentions 2020-09-09 21:22:07 +02:00
Roman Volosovskyi
57728224d4
[mentions] ParsedText in quoted message
ParsedText is needed to properly display mention in quoted message.
2020-09-09 16:07:31 +03:00
Andrea Maria Piana
32b0af8ecc Add index to emoji reactions 2020-09-09 15:02:54 +02:00
andrey
3b748a2e46 group chat invitation 2020-09-07 12:15:58 +02:00
andrey
2eaa1fcad7 [#11046] Add local contact names 2020-09-07 11:34:06 +02:00
Volodymyr Kozieiev
88a3022ea8
Drop messages with text longer than 4096 characters (#2029) 2020-09-01 17:38:36 +03:00
Andrea Maria Piana
4a87764cca
seed mrand 2020-09-01 10:31:12 +02:00
Andrea Maria Piana
2ef1aa89f4
Handle connection change
Currently messenger has no notion of being online.
This might cause a problem as we retry to register with a push
notification server even if not connected to any peer, which will
inevitably fail.
This commit adds a method `handleConnectionChange` that will be called
every time the connection change state.
2020-08-27 18:54:31 +02:00
Andrea Maria Piana
0ff2542939
Don't add contact on update
When sending a contact update we automatically added the contact,
but that resulted in the contact not being synced correctly as
`saveContact` will not trigger the side effects.

For now I have removed this behavior. Ideally we should have a single
call that handles the side effects, but for that ENS names should be
stored in messenger, so we can propagate it.
2020-08-27 18:54:30 +02:00
Andrea Maria Piana
640f5533ca
handle notifications at-most-once 2020-08-27 18:54:29 +02:00
Andrea Maria Piana
d7222c89e0
shuffle servers and limit & filter by chat id 2020-08-27 18:54:28 +02:00
Andrea Maria Piana
401d18e558
Enabled push notifications by default and add fleet 2020-08-27 18:54:06 +02:00
Andrea Maria Piana
d09eaeacb8 Allow node to start a push notification server
This commit allows a node to start a push notification server.
If the config is set it will start a messenger with a corresponding pn
server.
2020-08-20 10:54:33 +02:00
Andrea Maria Piana
ac6aff2486
Re-issue bundle on changed parameters 2020-08-19 11:57:39 +02:00
Andrea Maria Piana
4cf491ae38
add push notification type 2020-08-18 16:29:58 +02:00
Andrea Maria Piana
874d1d0fa6
Update protocol/pushnotificationclient/client.go
Co-authored-by: Samuel Hawksby-Robinson <samuel@samyoul.com>
2020-08-18 16:29:57 +02:00
Andrea Maria Piana
2b2616f82c
Bump version to 0.57.0 2020-08-18 16:29:55 +02:00
Andrea Maria Piana
5544e710ab
send push notification info with contact code 2020-08-18 16:29:38 +02:00