Commit graph

124 commits

Author SHA1 Message Date
lilia
98a14e9a6a Fix bug in message model
conversation.changedAttributes returns false when there are no changes.
2015-08-03 11:02:54 -07:00
lilia
3e73f8f0ba Resolve conflicts in series
Attempting to resolve outgoing conflicts in parallel triggers multiple
requests for new keys from the server and causes it to return a 500
error.
2015-08-03 11:02:54 -07:00
lilia
ccfae3c78a Fix bug in identity key conflict edge case
When resolving conflicts, we should not only discard the old key, but
set the new trusted key to the one the user has verified. Previously, we
would end up trusting the first-seen new key, which may not be the one
the user verified.

 // FREEBIE
2015-07-31 17:01:03 -07:00
lilia
d808d255eb Fix bug with 0th contact color
Contact color css class wasn't being rendered because 0 is falsey.

// FREEBIE
2015-07-31 17:01:03 -07:00
lilia
47b58b8994 Use the correct number of contact colors
Bugfix from 2f12275
2015-07-31 11:13:30 -07:00
lilia
2f12275cb9 Update contact colors
Make default contact color assignments consistent with
WhisperSystems/Textsecure@99d3a76b
2015-07-31 11:07:42 -07:00
lilia
fd5b0aeb85 Set lastmessage text on convo's with no timestamp 2015-07-22 15:24:03 -07:00
lilia
17a3025af2 Mark end session messages sent 2015-07-16 12:14:09 -07:00
lilia
9dfff879b6 Remove usage of extension.trigger
This trigger function uses chrome's runtime message passing api, which
traverses between different windows in our runtime, but we only trigger
the updateInbox event from the backgroud page, so we don't need to use
that api, which requires some extra cpu/memory overhead.

// FREEBIE
2015-07-16 12:13:45 -07:00
lilia
853b578551 Change default value for active_at
We're overriding the default with null often enough that we should
just change the default.

Consequently, no more phantom blank conversations with oneself should
appear after receiving a group update. They were being added to the
inbox because they were incorrectly initialized with an active_at value.

Fixes #281
2015-07-14 16:44:08 -07:00
lilia
b44c12807c Mark messages sent after resolving outgoing key conflicts 2015-07-09 11:31:43 -07:00
lilia
cfc3b8e6a5 Fix phantom outgoing messages
This bug was caused by a race between indexeddb requests and sending
messages. Order of events to repro was roughly:

1. send async idb request for current message list
2. add new message(s)
3. idb request returns with now incomplete message list
4. message collection gets reset to list from 3, removing messages
added in 2, but not removing their phantom views/dom elements. (bug)
5. send another idb request for current message list
6. idb request returns bearing all messages including those from 2.
7. messages from 2 are added and rendered a second time.

The fix was simply to not remove messages in 4, which means we reuse the
original message model object rather than recreating it in 7.

Fixes #243

// FREEBIE
2015-07-08 11:57:16 -07:00
lilia
fa4022a4e3 Invert pending/sent model 2015-07-07 23:03:56 -07:00
lilia
a66195a98f Fix messages stuck in pending state
The unset function, and the series of events/callbacks triggered by its
use, are not as similar to the set/save functions as previously
anticipated, leading to flux in the state of the 'pending' attribute.

Fixes #283

// FREEBIE
2015-07-07 16:15:23 -07:00
lilia
3cbe4f1f46 remove unused argument 2015-07-07 16:03:12 -07:00
lilia
29360fea5c Fixes #275 default group image 2015-06-26 11:30:54 -07:00
lilia
feb5e5b068 Display gray # instead of colored + for no-name contacts
For consistency with android.
2015-06-25 13:47:46 -07:00
lilia
e26b9bfbc7 Default avatar support
Fixes #264

Implement the equivalent of java's String.hashCode on the conversation model.
Change avatar template and attributes. Use css classes for colors.
2015-06-19 11:50:18 -07:00
lilia
6a5f923cac Don't set attributes redundantly
By the time we get here, these should have already been set in
background.js.

// FREEBIE
2015-06-17 12:29:40 -07:00
lilia
18433419c9 PushMessageContent is now DataMessage 2015-06-17 12:29:40 -07:00
lilia
290283f810 Conversations do not require timestamps
Synced contacts will not include timestamps
2015-06-17 12:29:40 -07:00
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