Commit graph

103 commits

Author SHA1 Message Date
lilia
a833d62a71 Implement sync protocol changes
Update protobuf definitions and refactor message receive and decrypt
codepath to support new protocol, including various flavors of sync
messages (sent messages, contacts, and groups).

Also cleans up background.js and lets libtextsecure internalize
textsecure.processDecrypted and ensure that it is called before handing
DataMessages off to the application.

The Envelope structure now has a generic content field and a
legacyMessage field for backwards compatibility. We'll send outgoing
messages as legacy messages, and sync messages as "content" while
continuing to support both legacy and non-legacy messages on the receive
side until old clients have a chance to transition.
2015-06-17 12:29:39 -07:00
lilia
9795b26bc1 Supress change event on avatarUrl initialization 2015-06-09 12:03:28 -07:00
lilia
363c436b33 Handle single-error rejections when sending messages
We can not assume that we will get back an error array.

Closes #258 // FREEBIE
2015-06-05 17:29:31 -07:00
lilia
6e1a41e9cf Update inbox when group avatars change 2015-06-05 11:53:46 -07:00
lilia
a66c879426 Update inbox after destroying a conversation
Fixes #247

// FREEBIE
2015-05-27 14:49:50 -07:00
lilia
3e39271220 Render messages light blue until finished sending // Fixes #219 2015-05-26 13:30:51 -07:00
lilia
405e67c758 Merge inbox and panel controllers
These collections should always be operating with the same model
instances, so let the inbox reset it self from the same in-memory
cache of conversation models used by the conversation windows.
2015-05-26 13:28:43 -07:00
lilia
b83ce7a015 Delay conversation creation til post-decrypt 2015-05-20 17:22:03 -07:00
lilia
08878b3dc8 Update inbox after sending a message
Also change the event name to reflect how its being used, and stop
passing the message object around since it is not being used.

// FREEBIE
2015-05-20 13:04:16 -07:00
lilia
e9d7864f75 Set conversation type when creating from sync message
When a conversation is created as the result of a sync message, and it
is not a group, we need to set its type to private.

// FREEBIE
2015-05-20 12:58:48 -07:00
lilia
1b83932a29 Update open conversations on sync messages 2015-05-19 13:34:51 -07:00
lilia
1ed0ef5bc3 Process group updates before sync delivery receipts
Because we need to know the group members to find early-arrival
receipts.
2015-05-18 14:23:09 -07:00
lilia
654373d743 Fix null conversationId on group sync messages 2015-05-18 14:08:19 -07:00
lilia
65a6068003 Fix for out-of-order message/receipt arrival
In a multi device world, it's possible to receive a receipt for a sync
message before the sync message actually arrives. In this case we need
to keep the receipt around and the process it when the message shows up.
2015-05-18 13:48:48 -07:00
lilia
c4fa2cb935 Fix sync message timestamps 2015-05-18 12:48:52 -07:00
lilia
20ebc3f890 Move identity key storage functions to axolotl store 2015-05-05 17:44:58 -07:00
lilia
71715c95bc Async remove identity 2015-05-05 17:44:57 -07:00
lilia
90c742d57c More error logging 2015-04-09 14:45:46 -07:00
lilia
c51773ab0e More helpful error logging 2015-04-05 16:42:07 -07:00
lilia
a2d88b4fad Don't trigger notifications for sync messages 2015-03-24 18:12:33 -07:00
lilia
ce36c36bd0 Include outgoing control messages in message history
So you know it worked.
2015-03-23 19:24:12 -07:00
lilia
f067bb9954 Remove dead code 2015-03-23 18:41:17 -07:00
lilia
fdb0935d6a Fix resolveConflicts for groups 2015-03-23 18:36:38 -07:00
lilia
a7079206f4 Nicer looking end-session and group control messages 2015-03-23 15:49:31 -07:00
lilia
9474b16eba In rare cases, a group has no members 2015-03-23 12:19:32 -07:00
lilia
06f4d4456d Fix empty notification on key conflicts 2015-03-20 10:47:58 -07:00
lilia
718f1a5e3d Improve notification contents
Include sensible descriptions of non-content messages. For group
messages, display the sender's name and avatar rather than the group's.
2015-03-19 18:34:10 -07:00
lilia
11b822eaf3 Allow unknown groups
Save groups even if we've never heard of them. Previously
we would fail to save due to a missing 'type' attribute.
2015-03-19 13:54:03 -07:00
lilia
9930937707 Move handlePushMessageContent to message model
And retool message handling flow to helps us avoid instantiating
duplicate message and conversation models.
2015-03-18 16:29:03 -07:00
lilia
897d391817 Improve identity key conflict ux
Clicking on a key conflict message opens the message detail view,
which displays the contact(s) in this conversation. If the message
contains a key conflict with any of these contacts, a button is
displayed which attempts to resolve that conflict and any other
conflicts in the conversation that are related to that contact.
2015-03-18 16:29:02 -07:00
lilia
857eee5003 Divorce identity wipe from tryAgain functions
We'd like to live in a world where we can retry all the pending
conflicts in a conversation as a batch, which means we don't want to
wipe the identity key before processing each message. Thus, remove that
step from these handlers and encapsulate in a method on the conversation
model.
2015-03-18 16:29:02 -07:00
lilia
c642854ddf Extract app-level logic from libtextsecure
Ensure that both tryAgain functions return promises, allowing the
application to take appropriate action in the result of success or
failure. This lets us remove all dependency from libtextsecure on
app-level constructs like message objects/ids and the `extenion.trigger`
function.

Corresponding frontend changes to follow in another commit.
2015-03-18 16:29:02 -07:00
lilia
cecb438a52 Simplify avatar rendering 2015-03-18 16:29:01 -07:00
lilia
fa3699cdd3 Trigger desktop notifications
Notifications show the conversation name, avatar, and new message text.
Clicking the notification opens the conversation.
2015-03-18 16:29:01 -07:00
lilia
04796e56d1 Fix tests 2015-03-11 20:41:15 -07:00
lilia
8e54aa1401 Plumb contact avatars into conversations 2015-03-11 17:49:01 -07:00
lilia
019a9d1fbc Unread counts
Update unreadCounts per-conversation on incoming messages. Render unread
conversations with font-weigh: bold in the inbox view.

To ensure that the inbox and conversation views remain in sync, the
background page now ensures that the same models objects are used for
both views.
2015-03-11 15:13:36 -07:00
lilia
2ee34343a8 Use consistent boiler plate throughout js files 2015-03-05 15:45:35 -08:00
lilia
c08c29bd4a Render group members in the message detail view
This requires that we fetch contact info when opening a conversation
so that's available for rendering contact names and avatars.
2015-02-26 13:35:04 -08:00
lilia
ec43a0b633 jshint all the things
Small style fixes here and there. Removed one unused file.
2015-02-19 00:22:23 -08:00
lilia
1bdb42b67e Fix bug loading conversation upsidedown
Sometimes a conversation's messages would be reverse-ordered on first
load, correcting themselves after a refresh. This is an artifact of the
order we load messages from the database. To fix, load them in the
opposite order.

The alternative solution would be to reset the collection every time we
fetch new messages, but this would create an entirely new set of model
objects each time, which seems unnecessary.
2015-02-18 15:40:34 -08:00
lilia
94c94eb7c9 Refactor message view
The message view has three flavors so far, a normal text+attachments
message, a group update, and an end session message. This changeset
extracts the normal message rendering into its own subview, and adds
some convenience functions to the message model in order to simplify
some of that flavoring logic.
2015-02-17 12:07:46 -08:00
lilia
488f25635d Wire up end session and leave group
Closes #136
Closes #137
2015-02-13 14:25:16 -08:00
lilia
44b1e5c88e Move inbox collection to the background page
No more waiting, no more messy fetch logic. Background page
bootstraps the inbox and keeps it up to date.
2015-02-12 13:21:17 -08:00
lilia
b27826cba5 Conversations must have an id before saving 2015-02-12 13:21:16 -08:00
lilia
c84ccfc735 Wrap model phonenumber validation in try/catch 2015-02-12 13:21:15 -08:00
lilia
eae072e72d Remove unneeded var, add todo 2015-02-12 13:21:15 -08:00
lilia
fc3a600e72 Validate conversation type 2015-02-12 13:21:15 -08:00
lilia
5e3ed1658b Show phone numbers in contact selector 2015-02-12 13:21:15 -08:00
lilia
d435ff003b Improve typeahead contact selector experience
Store and match on various phone number formats. Still not perfect, as
occasionally all the models are returned for a non-matching query.
2015-02-11 17:38:01 -08:00