Commit graph

227 commits

Author SHA1 Message Date
lilia
dd7d72a77d i18n 'Media message'
Fixes #736

// FREEBIE
2016-04-18 19:15:36 -07:00
lilia
172d843368 Always update lastMessage on incoming messages
Fixes #742

// FREEBIE
2016-04-18 19:15:35 -07:00
lilia
0cd7f84a05 Refactor read state tracking
Adds support for handling early arriving read receipts.

// FREEBIE
2016-04-14 11:57:52 -07:00
lilia
d1e9534542 Refactor delivery receipt tracking
Move code for matching receipts to messages (and vice versa) to its own
file.

// FREEBIE
2016-04-13 13:57:56 -07:00
lilia
18012688ea Log unread message timestamps
// FREEBIE
2016-04-13 13:57:55 -07:00
lilia
0f4f00ff4e Fix read sync on duplicate messages
In the case of a double send (same message encrypted and sent twice due
to key conflict bug), we would mark the first instance read twice rather
than marking both instances read. Fix by searching for matching messages
that have not yet been marked read.

// FREEBIE
2016-04-04 16:14:15 -07:00
lilia
07a0463b65 Fix conversation list self-resorting
When deleting all messages in a conversation, the entry in the left pane
should be inserted into the alphabetical portion of the list. To keep it
in this collection, do not nullify active_at.

To ensure the list view is keeping itself correctly sorted, make sure
that resorting behavior is triggered any time a relevant attribute is
changed.

This fixes deleted conversations jumping to the top of the list, and
conversation order scrambling when getting a group or contact sync
message from our master device.

Fixes #734

// FREEBIE
2016-03-25 14:32:57 -07:00
lilia
3901bcb8df Style resend button as an inline link
For messages that failed to send due to network errors, this change
allows retrying them directly from the main conversation view rather
than only from the message detail view.

// FREEBIE
2016-03-22 15:38:22 -07:00
lilia
234f937bc7 Conversation subscreens share a header
// FREEBIE
2016-03-21 15:37:53 -07:00
lilia
c8aa2246dc Let groups have blue headers
// FREEBIE
2016-03-21 13:02:34 -07:00
lilia
18a5ce8e54 Restyle conversation panel
// FREEBIE
2016-03-18 13:09:45 -07:00
lilia
8b3596b956 Delete last timestamp on a convo when deleting messages
// FREEBIE
2016-03-18 11:21:11 -07:00
lilia
6f3f33657a Don't mark read on sync messages
There's no longer a need for this since we have read-state syncing.

// FREEBIE
2016-03-18 11:20:52 -07:00
lilia
762cb68721 Serialize sending and adding messages to a convo
Previously, if a message was sent in between the receive time of an
incoming message and the time it is actually added to the conversation's
message collection (which only occurs later after several async
callbacks), the incoming message would be inserted not-at-the-end of the
collection since it is ordered by receive time. This tricked the front
end into assuming the message was an older message instead of a new one.

Fixes #490

// FREEBIE
2016-03-17 15:41:01 -07:00
lilia
f9a3c7817e DRY up early receipt processing
// FREEBIE
2016-03-17 15:39:28 -07:00
lilia
67900753d1 Log sending read receipts
// FREEBIE
2016-03-14 16:26:22 -07:00
lilia
0763cf14a3 Remove messages from notifications when read
Remove individual messages from Notifications when marked read.
Previously this was only done from the conversation model when marking
the entire conversation as read.

Fixes #717

// FREEBIE
2016-03-08 12:03:16 -08:00
lilia
2b7cbef8b1 Rename a function
Avoid confusing this operation with actual receipts, which are something
else.

// FREEBIE
2016-02-26 12:41:29 -08:00
lilia
b77d5df4f2 Fix markRead when messages have not been loaded yet
Query the database and not just the in-memory messages.

// FREEBIE
2016-02-26 12:36:14 -08:00
lilia
01053335ac Don't send empty read status reports
// FREEBIE
2016-02-26 12:28:14 -08:00
lilia
f88b33a135 Fix unread message lookup in markRead
// FREEBIE
2016-02-26 12:27:44 -08:00
lilia
c4a88dd651 Fix getUnread query
Booleans are not valid keys in indexeddb.
https://www.w3.org/TR/IndexedDB/#dfn-valid-key

// FREEBIE
2016-02-26 12:25:56 -08:00
lilia
2e30c4388f Set destination on end session messages for syncing
// FREEBIE
2016-02-24 23:10:16 -08:00
lilia
e91f646920 Fix initial post-sync timestamps
Fixes #669

// FREEBIE
2016-02-24 17:11:59 -08:00
lilia
71467822f6 Clear key conflict before replaying it
Don't save the change until we successfully process the message, but
make it first so that the user sees the error disappear when the new key
is accepted.

// FREEBIE
2016-02-22 17:11:17 -08:00
lilia
1f897f32b7 Track and sync unread messages
// FREEBIE
2016-02-22 17:11:17 -08:00
lilia
ecf2885a6c Do post-send tasks when resolving conflicts
Fixes #684

// FREEBIE
2016-02-22 17:11:16 -08:00
lilia
731052ad0a Clear old key conflict errors after failed replay
If the replay failed due to a bad mac or other decryption error for some
other reason we still want to clear the conflict. If it failed because
it's still in conflict then the newly returned error will reflect that
and be saved.

// FREEBIE
2016-02-22 17:11:16 -08:00
lilia
7e8ce5eb54 Omit left groups from search
Unless they contain messages.

// FREEBIE
2016-02-22 17:11:16 -08:00
lilia
010297f4c5 Track groups I've left
// FREEBIE
2016-02-22 17:11:16 -08:00
lilia
173e037fa6 Fix minor style errors
And keep it that way, by making jscs config more opinionated.

// FREEBIE
2016-02-18 13:45:22 -08:00
lilia
b602533084 Serialize calls to sendSyncMessage
Fixes #679

// FREEBIE
2016-02-16 17:46:20 -08:00
lilia
7e82d1295c Handle attachment upload errors
Adds a new kind of replayable error that handles retry of pre-encryption
failures, e.g., attachment upload.

Fixes #485

// FREEBIE
2016-02-09 13:21:32 -08:00
lilia
137b992f87 Fix "Delete Messages" not deleting all messages
Since the introduction of infinite scroll, the delete messages function
has only deleted the currently loaded set of messages in a conversation.
To fix this, we should fetch all the messages and then delete them.

Fixes #645

// FREEBIE
2016-01-27 15:06:16 -08:00
lilia
b2bed9c51c Fix display of empty group updates
Group updates in which nothing change should still display 'Updated the
group'. Previously they would display as empty message bubbles. Fixed by
ensuring that the 'group_update' attribute is set on the model, even if
it is an empty object.

// FREEBIE
2016-01-12 10:44:52 -08:00
Karel Bilek
557d33bf88 Fixing upper bounds on contact search (fixes #545) 2016-01-02 04:23:21 -08:00
lilia
1d6e391dd6 Prefer single quotes
// FREEBIE
2016-01-02 02:51:25 -08:00
lilia
bc576e18d5 Fix no delivery receipts on close session messages
// FREEBIE
2015-12-11 12:06:45 -08:00
lilia
dabe51fd68 Mark message sent iff at least 1 recipient got it
Previously, we would always mark a message sent even if all our network
requests failed.

Fix #484

// FREEBIE
2015-12-10 16:21:21 -08:00
lilia
63135a2337 Fix race between sync messages and receipts
Previously, when processing a backlog of sync messages and their
delivery receipts, we would fail to mark some messages as delivered even
though we got a receipt. This was due to an async race condition between
saving a sync message and fetching it after the receipt arrives.

Fix by re-ordering idb requests such that we save the message first and
fetch it after.

Fixes #479

// FREEBIE
2015-12-10 10:36:15 -08:00
lilia
720032bb8e Remove id from search tokens
Instead, just strip the leading + from search queries that look like
numbers.

// FREEBIE
2015-12-09 18:58:51 -08:00
lilia
a258f1a66b Refactor number parsing and validation
Refactor libphonenumber.validateNumber into libphonenumber.parseNumber,
which encapsulates the try-catch pattern used in number parsing and
returns an object of info about the input number rather tha throwing
since we expect to get some invalid number inputs the user is typing.

In the conversation model,
  * Separate phone number validation from search token updating.
  * Perform token update before save if the number was valid.
  * Stop storing unneeded number variants as conversation properties.

// FREEBIE
2015-12-09 18:58:51 -08:00
lilia
65c13adf5e Fix searching for numbers with parens or dashes
Strip some punctuation from search queries

// FREEBIE
2015-12-09 18:58:51 -08:00
lilia
af64784d64 Let search match on full e164 format numbers
// FREEBIE
2015-12-09 18:58:51 -08:00
lilia
0b7742ecd7 Create contact by number with no country code or +
Search box finds or creates a conversation given a phone number in
local (to the user's region) or international format.

Previously you had to enter e164 format to set up the conversation
correctly.

If the number is not valid, do not open the conversation.

TODO: user feedback on invalid numbers.

// FREEBIE
2015-12-09 18:58:50 -08:00
lilia
0b95606eff Display nicely formatted phone numbers
In conversation headers and as titles for contacts with no name. Updated
tests accordingly.

// FREEBIE
2015-12-09 18:58:50 -08:00
lilia
0620f08a7c Save single errors returned from send functions
// FREEBIE
2015-12-04 12:02:19 -08:00
lilia
2f469835d9 Handle group quit sync messages
Previously, we would incorrectly reject group updates originating from a
linked device instructing us to remove ourselves from the group.

// FREEBIE
2015-12-04 11:25:19 -08:00
Georg Semmler
1a6cedac56 Fix #402
Remove messages which are read from the notification
2015-12-01 13:31:02 -08:00
lilia
7bf94c33d5 Show all contacts when inbox is empty 2015-11-27 22:26:55 -08:00