Commit graph

297 commits

Author SHA1 Message Date
Scott Nonnenberg
89046484ed Read receipts: Also mark all messages read prior to this one
We mark as read everything older than this message - to clean up old
stuff still marked unread in the database. If the user generally doesn't
read in the desktop app, so the desktop app only gets read receipts, we
can very easily end up with messages never marked as read (our previous
early read receipt handling, read receipts never sent because app was
offline).

FREEBIE
2017-06-07 15:46:21 -07:00
Scott Nonnenberg
6bfeb7ab14 Conversation.sendMessage: Don't set unreadCount to zero
This is no longer guaranteed to be true. If you're scrolled up in a
conversation, you may not have read all messages. Setting the
unreadCount to zero will prevent the user from marking any of their
existing messages as unread until something else happens, like receiving
a read receipt or new message.

FREEBIE
2017-06-07 15:27:27 -07:00
Scott Nonnenberg
fb7e7cf34c TimerView: don't continue to update after expiration
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg
ec22445f75 Bulletproofing of markRead and findNewestVisibleUnread
FREEBIE
2017-06-01 16:09:27 -07:00
Scott Nonnenberg
b60b20bde4 Mark messages read only when visible, on receipt, focus, scroll
- Only mark messages read when scrolling if in focus and visible
- Remove last seen indicator when scrolling to the bottom with scroll
  down button
- Update last seen indicator when we don't already have one and we're
  scrolled up.

FREEBIE
2017-06-01 16:09:27 -07:00
lilia
3dbb21c53c Fix being re-added to a group you previously left
Negate the flag marking the group as left. Fixes #1207.

// FREEBIE
2017-05-30 10:51:07 -07:00
Scott Nonnenberg
10c2874d19 Fix race condition: Pull from database after add to conversation
Also add some console logs to help us determine whether this ever
happens to people in the wild.

FREEBIE
2017-05-26 16:02:14 -07:00
Scott Nonnenberg
3beecce94e fetchConversation: Minimize scans across loaded messages
FREEBIE
2017-05-25 16:30:30 -07:00
Scott Nonnenberg
d5d1d58cc2 Exclude Backbone-sourced method from jscs checks
FREEBIE
2017-05-25 16:30:30 -07:00
Scott Nonnenberg
3ceb3a049e Override Message.fetch to ensure that db data overrides local
FREEBIE
2017-05-25 16:30:30 -07:00
Scott Nonnenberg
2c81539042 A guard to prevent infinite loops in fetching of conversation
FREEBIE
2017-05-25 16:30:30 -07:00
Scott Nonnenberg
30b7bf23db Recursively fetch messages until we've loaded all unread
FREEBIE
2017-05-23 11:08:23 -07:00
lilia
80bfe18f02 Mark groups left on synced "You left the group"
When leaving a group on mobile, we sync the group quit message to desktop, but
we weren't marking the conversation left.

// FREEBIE
2017-05-16 15:23:29 -07:00
lilia
8bd7280673 Early read receipts should start expiration timers
Check for early read receipts for an incoming messages *after*
processing the expireTimer on that message. Then we can set
expirationStartTime appropriately if an early receipt is found.

Closes #950

// FREEBIE
2017-05-11 13:47:58 -07:00
lilia
aed5735620 Improve keychange notice reliability/perf
Bind a single listener to keychange events from the storage interface,
which then looks up relevant conversations and adds notices to them,
with tests.

Previously we would need to instantiate a conversation model in order to
start listening to its key change events. In practice this usually
happens at startup but we shouldn't rely on it, and it incurs higher
overhead since it creates a different listener for each conversation.

// FREEBIE
2017-05-09 15:41:41 -07:00
lilia
787c393e1b Log key change advisory creation
// FREEBIE
2017-05-09 15:28:16 -07:00
lilia
8aa2f771a7 Remove self-listener in conversation model
Since there is the only source/listener on this event, it can be called
directly.

// FREEBIE
2017-05-09 15:28:16 -07:00
lilia
510a5cb7fe Namespace global listeners to Whisper 2017-04-12 20:43:16 -07:00
Sam Vevang
ed4991974b set up a new view for displaying the network status
// FREEBIE
2017-04-08 00:10:56 -07:00
lilia
e4b9c51f88 Rework expiring messages management
// FREEBIE
2017-02-22 16:18:01 -08:00
lilia
08e8c00329 Restore setting lastMessage in handleDataMessage 2017-02-22 16:15:27 -08:00
lilia
ace59147ab Reduce unnecessary updates on conversations at startup 2017-02-22 01:22:44 -08:00
lilia
6509646bdb Set expireTimer to null to unset
// FREEBIE
2017-02-22 01:17:20 -08:00
lilia
54b856139a Fix fetchExpiring 2017-02-17 12:10:20 -08:00
lilia
e648a4b095 Revert "Remove unregistered group members"
This reverts commit a768b94471.

d2ddfc7 was enough to fix #989. Removing unregistered members from the
group (as opposed to silently ignorning them) creates greater potential
for getting out of sync with the member lists on other devices.

// FREEBIE
2017-02-16 18:06:20 -08:00
lilia
cd0fe7037b Add replayable error for signed key failure
Disable message sending if signed key updates fail too many times, but
allow the user to retry sending.

// FREEBIE
2017-02-16 18:06:19 -08:00
haffenloher
a768b94471 Remove unregistered group members
Locally remove unregistered users from group membership lists.

Fixes #989
Related to Whispersystems/Signal-Android#6175
Closes #1052

// FREEBIE
2017-02-08 17:13:36 -08:00
haffenloher
04f0142b23 Ignore missing members in incoming group updates
Previously, updateNumbers would throw an Error, so the whole group
update was discarded.

Signal-Android handles this the same way in
GroupMessageProcessor.handleGroupUpdate().

Closes #1056
2017-02-08 16:46:09 -08:00
Thomas Guillet
400313f749 Prevent expiration timer update on group update
It occurs when a message with a different expiration time is received.

The issue report highlights the scenario of a member leaving a group
(group update [quit] sent with expiration time = 0).

Fix https://github.com/WhisperSystems/Signal-Android/issues/5996
Fix https://github.com/WhisperSystems/Signal-iOS/issues/1566
2017-01-25 20:40:25 -08:00
lilia
9ef61d43f4 Update conversation lastMessage from database
Don't set lastMessage, let it update itself as needed, such as when
first rendering a conversation list item, and when its messages are
sent, received, or destroyed.
2017-01-25 20:40:25 -08:00
lilia
6253269d19 Tweak key change advisory insertion
Let received_at be the current time for keychanges. This avoids them
being inserted in the wrong place in the thread.

Use the newmessage event to trigger frontend listeners to add them to
the conversation view if it is open.
2017-01-25 20:40:25 -08:00
lilia
a623f909f2 Move key change advisory content to the model
Return this content from a helper method so it can be used to populate
the last message on conversations.
2017-01-25 20:40:25 -08:00
lilia
d2c1e6df27 Fix wrong variable name
Fix potentially setting expiration timeouts more than once.
2017-01-25 20:40:24 -08:00
lilia
d7f241ddee Use correct type on timer updates 2017-01-25 20:40:24 -08:00
lilia
05ed7c3822 Merge timer update functions 2017-01-25 20:40:24 -08:00
lilia
0854b19371 Revert "Don't load group contacts unnecessarily"
This reverts commit 6699571910.

Not quite ready for primetime.
2016-11-16 22:25:36 +01:00
lilia
6699571910 Don't load group contacts unnecessarily
There are some cases when we want to initialize a group object without
loading its contacts, such as while processing delivery receipts. We
really only need to load the contacts for a group/convo when we are
rendering it, so let the front end handle those cases (which most of
them do already).
2016-11-16 13:33:04 +01:00
lilia
03c5d12edd Fix necrobumping convos on key change
When inserting key change advisories, use the current conversation
timestamp to avoid pushing lots of old groups to the top of the
conversation list.
2016-10-12 11:34:49 +09:00
lilia
f8a3ae158c Remove log message 2016-10-06 18:18:54 +09:00
lilia
d3a2f5c838 Ignore expireTimer on session reset messages 2016-10-05 22:32:40 +09:00
lilia
4ee2652367 Fix wrong contact in some timer updates
Mistakenly showed 'You' for timer updates inferred from incoming
messages.
2016-10-05 22:31:30 +09:00
lilia
7fe708d195 Insert keychange advisories
On click, these open a verification panel for the relevant contact,
within this conversation.

// FREEBIE
2016-10-05 19:11:39 +09:00
lilia
009098f8dd Insert inferred timer updates before the corresponding message 2016-10-05 19:09:21 +09:00
lilia
a12569e356 Fix destination on synced timer updates 2016-10-05 19:09:20 +09:00
lilia
56aee5e8ef Update conversation snippets automatically
Fixes stale snippets after the message has expired
2016-10-05 19:09:20 +09:00
lilia
8d16bfb65e Populate conversation snippet for timer updates 2016-09-29 16:17:01 -07:00
lilia
e488c19889 Do not trigger notifications for timer updates 2016-09-29 16:17:01 -07:00
lilia
7a26cf79ee Insert timer update messages when inferring timer changes 2016-09-29 16:17:01 -07:00
lilia
ad2174e279 Sync expirationStartTimestamp on outgoing messages
Linked devices need to know when to start the clock.
2016-09-29 16:17:01 -07:00
lilia
6074a29046 Send timer update messages when changing the timer 2016-09-29 16:17:01 -07:00