Commit Graph

103 Commits

Author SHA1 Message Date
yenda b80e02d8cf
[feature] add block user feature in user profile
- add block/unblock action to user profile
- blocking deletes all messages from user and ignores future messages
- unblocking stops ignoring new messages from user but doesn't recover past ones

[feature] add contact list

[tests] added scroll to BackupRecoveryPhraseButton

[tests] added scroll to public key

Signed-off-by: yenda <eric@status.im>
2019-02-05 16:29:56 +01:00
Andrea Maria Piana dfdbe1ccbc
Paginate using clock-value & message-id instead of skip/limit
Paginating using the count of loaded messages might result in some
messages being skipped and not being loaded in the database, in case of
out-of-order messages received.

This commit changes the behavior to sort by `clock-value` and
`message-id`, which gives a consistent sorting.

The initial idea was to use a cursor `clock-value-message-id` and
iterate on that, but realm does not support filtering on string (</>),
so instead we keep track of messages with identical clock-value and
exclude those in the next page query.

The change might result in pages that have duplicates (so messages needs
to be deduped), but won't result in skipped messages.
2018-12-24 18:12:50 +01:00
Roman Volosovskyi 8f48dc8df6
Safe deserialization of the last message's content
The issue was fixed in #7085 but reintroduced in #7055.
2018-12-24 18:09:59 +02:00
Roman Volosovskyi c440b7a3a7
[slow sign in] Denorlmalize last message
The last messages of the chats are necessary to properly show the chat
list, which is shown right after signing in. Before this commit, the
last message was retrieved as one of 20 last messages fetched for each
chat.

Implementation:
- `:last-message-content` and `:last-message-type` fields were added to
  `chat` entity
- both fields are updated when messages are received/sent
- loading of the last 20 messages for each chat was removed as
  initialization step
2018-12-17 13:29:10 +02:00
Andrea Maria Piana 54b9ba5a2e
Dont choke on wrongly serialized messages
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-12-14 16:59:34 +01:00
Roman Volosovskyi e7d0312d25
[#6903] fix replies compatibility
Issue was caused by https://github.com/status-im/status-react/pull/6722

Implementation:
1. `old-message-id` field (indexed) was introduced in `message` entity
   and is calculated as `message-id` was calculated in `0.9.31`
```clojure
(defn old-message-id
  [message]
  (sha3 (pr-str message)))
```
2. When a reply message is sent from the PR version of app both `response-to`
   and `response-to-v2` fields are sent as a part of `message`'s `content`
   field, so that it can be recognized by `0.9.31`.
3. When PR version of app receives reply from `0.9.31` we check whether
   message's `content` contains `response-to` but doesn't contain
   `response-to-v2`, and if so we check whether DB contains message with
   `old-message-id=response-to`. If such message has been found we assoc
   `response-to-v2` to content.
4. If message from DB contains only `response-to` but not `response-to-v2`
   attempt to fetch the message by `old-message-id` is done.
2018-12-05 07:22:40 +02:00
Roman Volosovskyi 5d5847e4b9
[slow sign in] Add unviewed messages counter to chat entity.
Before we fetched ALL user-statuses with `status=received` (which means that
a message hasn't been seen), iterated them, grouped by chat and then stored
`message-ids` of these `user-statuses` in chat's `:unviewed-messages` key.

This commit introduces :unviewed-messages-count field in chat entity.
That means that there is no need to iterate `user-statuses` in order to count
a total number of unviewed messages, it is always stored along with chat.
In the rest of it, the difference is only that chat's db record should be
updated each time when unviewed messages are seen.
2018-11-23 17:08:48 +02:00
Roman Volosovskyi d66198a420
[slow sign in]
fix iterating over all messages from realm db (was done for deduplication)
async loading of chats (:init-chats event)
2018-11-21 18:21:52 +02:00
Roman Volosovskyi 1dcc7727f1
[slow sign in] faster :get-referenced-messages 2018-11-21 10:50:45 +02:00
Roman Volosovskyi b792ab5cf3
[slow sign in] faster get-unviewed-messages 2018-11-21 08:04:33 +02:00
Eric Dvorsak f8f499d9b0
[refactor] rename whisper-id and whisper-identity to public-key 2018-11-09 11:16:27 +01:00
Andrea Maria Piana 7aa597517e
Add system messages to group chats
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-11-05 14:54:43 +01:00
janherich 76165cc7cb
[#6460] [#6438] Deduplication-ids 2018-10-24 09:43:52 +02:00
janherich 99d33ebbc9
Always load messages referenced in responses 2018-10-11 11:21:34 +02:00
janherich 44fbe62773
Chat replies + refactoring 2018-09-28 16:15:47 +02:00
Eric Dvorsak 6d84795b2a
[fix 5738] unread counter disappears after app restart
`get-unviewed-messages` cofx was using the `current-public-key`
field from app-db
since it is not set at the point cofx are computed during the init
phase this field is nil and therefore no unread messages were found

the fix changes the cofx so that it returns a function as it is
already done for many cofx that needs parameters that are not
known at the time cofx are computed.

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
2018-09-04 14:08:11 +02:00
Andrea Maria Piana b34744133b
[fixes #4745] Don't query mailserver on restored account
When creating a new account / recovery we don't poll the mailserver anymore for historic messages, which solves the immediate issue of fetching only received messages

Handle messages sent from a different device in public chat / restore history. The message will be added, shown correctly as sent by the user, and the status will be set as sent ( need to check for seen race condition, as messages will now be added twice). This means that multidevice should now work for public chats.

Move contact updates to discovery topic. This is necessary as there is a pre-existing bug whereby contact updates would not work anymore after wallet recovery, as the code relies on the initial contact request being stored on the mailserver, which we cannot guarantee (we only pull 7 days of data). Not pulling history anymore exacerbate the problems but does not introduce it.
To make sure that contact updates will work after wallet recovery, we also need to consider a ContactUpdate in the same way we consider a ContactRequest (the other peer has no idea that the user has recovered the wallet). This does not change any behaviour in terms of obscurity/security as ContactRequest are automatically processed (in both case the contact will be set as pending?, not as accepted)
At this stage ContactRequest, ContactRequestConfirmed, ContactUpdate have all the same logic, i.e. update the contact information, leave the pending flag alone.

Only 1 day of history is fetched for newly joined chats, if catching up 7 days is the cap as before.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-07-03 17:21:59 +02:00
Pedro Pombeiro 227014674c
Add 6 new languages as public channels in the localized language. Closes #4753 2018-06-20 19:11:56 +03:00
janherich 4ba78de407
Faster seen marking
Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
2018-06-11 12:16:42 +02:00
janherich cd5542f648
Persist unseen messages 2018-06-05 15:24:55 +02:00
janherich 62a9f26e30
First stage of realm transactions 2018-05-10 17:21:23 +02:00
Roman Volosovskyi 6c620728da
reformat status-im.data-store.* namespaces
reformat status-im.utils.* namespaces
2018-05-08 09:01:24 +03:00
Dmitry Novotochinov a8a03067a1
Add resend and delete message actions
* Set message status based on signal from Go
* Set status as "not-sent" on app start if no signal received

Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
2018-04-27 11:03:42 +03:00
Andrea Maria Piana 3256d67c2e
Add clock values for public group/chats
I have extended and modified the current algorithm for message ordering
so that it applies for group and public chats alike.

We use Lamport timestamps but we prefix the unix timestamp, which should
maximize the chances of the message being seen on the top of the chat.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-04-10 12:19:42 +01:00
Eric Dvorsak df17c50612
Add new protocol
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-04-05 15:40:30 +01:00
Itoh, Masaru 98a0c2081f
Refactor timestamp
Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
2018-03-15 11:53:23 +00:00
janherich 80fb8dde8b
Read at startup & write through async queues 2018-02-05 12:28:08 +01:00
Foo Pang ae04dde8ba
[Fix #3076] Separate figwheel from dev lein profile
Signed-off-by: Dmitry Novotochinov <trybeee@gmail.com>
2018-02-02 17:02:45 +03:00
janherich 201484f37f
Faster msg status updates 2018-01-09 15:00:06 +01:00
janherich 52ddccca96
Refactored statuses 2018-01-04 13:49:21 +01:00
alwx a813ff9e9f Chat refactoring: updated console (former sign-up) namespace 2017-12-25 22:16:01 +03:00
janherich eb8d0a8a79
Refactored message data-model and view 2017-12-19 12:50:36 +01:00
Eric Dvorsak df83cbb987 update realm version 2017-11-04 11:00:14 +01:00
Roman Volosovskyi 5dd2f899ad remove password from db
fix incorrect :bot field in commands and requests
2017-10-27 18:09:00 +02:00
alwx cb72190a18 API commands scopes, changes for API semantics (#1546) 2017-10-16 09:51:52 +02:00
Herich d9db548e57 Refactoring chat events to shorten event chains 2017-10-03 09:28:38 +02:00
Herich f5b0c0c368 chat, data, utils: add implementation of simple preview caching 2017-07-26 15:00:14 +03:00
alwx 5c15df9b64 /send and /request commands; commands in group chats and fixes for parameter and result boxes 2017-07-10 12:41:30 +03:00
alwx 1b2f657bfb Support for status-dev-cli 3.2.0 — NDS, responses and 3 more commands 2017-05-24 12:49:17 +03:00
Roman Volosovskyi 03cab7ace2 interactive suggestions 2017-04-28 15:08:53 +03:00
alwx a15fb7e2a8 New chat input & suggestions area; new handlers to work with the improved logic (#880) 2017-04-13 18:17:56 +03:00
alwx 78e70571df Generating message preview on the fly, localization of request data and previews (#645, #754) 2017-02-01 16:12:45 +02:00
Roman Volosovskyi 81257b815a unused symbols 2017-01-16 08:25:45 +02:00
Roman Volosovskyi 0c69a27d95 unused aliases 2017-01-16 08:23:02 +02:00
alwx 158d0ba033 Order of messages fix (#550) 2016-12-20 14:56:37 +03:00
alwx 3e574fd65f Several messaging fixes: latest message (#507), no more clock-value bugs, some UI fixes 2016-11-30 17:14:37 +03:00
Roman Volosovskyi 80be20666b send command styling 2016-11-18 17:13:38 +02:00
Adrian Tiberius 8a4b5cccb1 fix nested-maps transform 2016-11-16 17:55:37 +02:00
Roman Volosovskyi 83e158cb80 fix flash, dapp icon on console icon, messages animation and other bugs related to #415 2016-11-05 16:24:10 +02:00
Alexander Pantyuhov 313c952e57 Wallet DApp Transaction History Messages
Former-commit-id: 77221afa4d128c089e73a86aa2291294c0e3a548
2016-11-02 22:11:45 +03:00
Alexander Pantyuhov 9993ebd074 Command as the last message (#367)
Former-commit-id: dc3d9f8931
2016-10-19 00:46:57 +03:00
Roman Volosovskyi 197695c79e fix #354
Former-commit-id: f51d932283
2016-10-14 16:42:30 +03:00
Adrian Tiberius 2c3eec3c43 added database migration functionality
Former-commit-id: a6f63a5b5f
2016-10-04 18:29:41 +03:00