Commit graph

476 commits

Author SHA1 Message Date
Matt Corallo
1e4a7108e3 Merge pull request #120 from WhisperSystems/testvectors
Re-add v3 testvectors with fixed sauce
2015-01-12 23:23:56 -10:00
Matt Corallo
fb03879d02 Re-add v3 testvectors with fixed sauce 2015-01-12 23:20:06 -10:00
lilia
d2ab8ddd5b Use a newer chrome version
One with webcrypto support
2015-01-12 23:16:20 -10:00
lilia
5c2006e159 Fix build: Revert "Update some of the testvectors to v3"
This reverts commit 33429bd6f7.
2015-01-12 22:29:23 -10:00
Matt Corallo
33429bd6f7 Update some of the testvectors to v3 2015-01-12 21:34:12 -10:00
Matt Corallo
2b0866ee1f Bring protocol_test back in-line with new APIs 2015-01-12 21:34:12 -10:00
Matt Corallo
6124084807 Bring padding calculation in-line with android 2015-01-12 21:26:12 -10:00
lilia
d8efc4d216 Handle incoming group avatars on group creation 2015-01-11 12:33:59 -10:00
lilia
3d6c251fd1 Group avatars 2015-01-11 01:27:22 -10:00
lilia
d52db8fe6f Render group updates
Not pretty, but it works. Also allows for later localization.
Copy/behavior is borrowed from the Android client.

Closes #104
Fixes #65
2015-01-10 08:08:20 -10:00
Markus Rothe
bcff1cf991 README.md: make links clickable 2015-01-09 07:55:14 -10:00
lilia
d08c2e496d Re-enable sauce for PR's
Revert "Do not run saucelabs tests on pull requests because they will fail"

This reverts commit 7b851ba548.

This seemed like a good idea at the time, but it prevents tests from
being run on PR's made from branches within our own fork. Also, in
hindsight, I find that the "merge with caution" alert banner is an
appropriate adornment for PR's which have not been able to run the
saucelabs tests due to their alien origin.
2015-01-07 19:33:23 -10:00
lilia
4e6faf4e27 Always listen for (re-)registration events
If we clear local storage and re-register in a foreground page, the
background page needs to re-init its websocket with the new account
credentials.
2015-01-07 19:09:07 -10:00
Matt Corallo
9a30a1e175 s/\t/ /g in manifest.json 2015-01-06 14:52:15 -08:00
Matt Corallo
d9db0f53e7 s/\t/ /g in {background,options}.html 2015-01-06 14:51:59 -08:00
Matt Corallo
b070c6ccb0 s/\t/ /g in stylesheets/options.css 2015-01-06 14:49:04 -08:00
Matt Corallo
2d41385369 Remove last \t in crypto_test.js 2015-01-06 14:47:39 -08:00
Matt Corallo
7ebf0f5085 Remove last \t in protocol.js 2015-01-06 14:47:03 -08:00
Matt Corallo
2c781e5b62 s/\t/ /g in test/index.html 2015-01-06 14:46:33 -08:00
Matt Corallo
28aa0a5508 s/\t/ /g in fake_api.js 2015-01-06 14:46:23 -08:00
Matt Corallo
1f8b8cd0ea s/\t/ /g in testvectors.js 2015-01-06 14:44:25 -08:00
Matt Corallo
406be10f53 s/\t/ /g in sendmessage.js 2015-01-06 14:39:54 -08:00
Lilia
cf99f03acd Merge pull request #107 from zmanian/FixTravisBuildsOnPullRequests
Fix for Travis Builds on pull requests
2015-01-03 10:42:17 +01:00
Zaki Manian
7b851ba548 Do not run saucelabs tests on pull requests because they will fail 2015-01-02 20:33:52 -08:00
lilia
fca67d7b0e Simplify pushMessageContent handler slightly
New private conversations have their type set in onMessageReceived. New
group conversations should be handled the same way as normal group
updates. It was pointed out we should never have to handle a group
message without a preceding group update, as those would be rejected by
textsecure.processDecrypted. An exception would be if you delete the
group from indexedDB but not localStorage, but that's not a mode we
should be supporting.

Also in this change I switched to instantiating a new conversation
object on every call to handlePushMessageContent. Originally, I thought
to use the local conversation list as a cache, but it's a bit simpler to
re-read from the database every time for now. Later on we should revisit
and optimize for fewer read/writes per incoming message.
2014-12-24 15:37:05 -08:00
lilia
0ea176dfa0 Don't require a conversation name
Just display a sensible default in the frontend if it's unset.
For private conversations this should be the phone number, for
groups, the list of numbers.
2014-12-24 14:32:11 -08:00
lilia
ff259a7dee Tolerate extra whitespace in the registration code field 2014-12-24 14:31:04 -08:00
lilia
0292c12712 Catch and save Bad Mac errors on the incoming message model 2014-12-23 18:31:57 -08:00
lilia
40b54185f3 If we happen to get a group message with no update, use a blank name 2014-12-23 15:07:43 -08:00
lilia
f23403f82b Fix arguments to sendMessageProto in tryMessageAgain
As ov ccc98d2 sendMessageProto takes a timestamp for the first argument,
in service of app-level delivery receipts.
2014-12-23 15:02:03 -08:00
lilia
f9e68be45b Don't refreshGroups in tryMessageAgain
This was intended to sync the group state of a recently re-installed
client, but is prone to overkill when we have a lot of old stale groups
around. Also this implementation incurs some rate limit errors from the
server.
2014-12-23 14:28:19 -08:00
Dave Sescleifer
2462aba24b Fixed timestamps and added last message to the gutter 2014-12-22 23:38:26 -08:00
Dave Sescleifer
1c47fb7ed8 Contact name now overflows into ellipsis 2014-12-22 23:38:26 -08:00
Dave Sescleifer
441962abc6 Fixed date format 2014-12-22 23:38:26 -08:00
lilia
1175f2ae3c Scratch that, reverse it. 2014-12-22 17:20:05 -08:00
Dave Sescleifer
893fffdad8 Added ✓ to delivered messages
Closes #100
Closes #101
2014-12-22 16:39:35 -08:00
lilia
8ed73d0ce5 Normalize send-path error handling
Receive and handle an array of errors in both the group and individual
cases.
2014-12-22 15:11:04 -08:00
lilia
80993753de Fix bug overwriting existing conversation names
On incoming messages for pre-existing conversations, don't update any
attributes unless it's a group update message.
2014-12-22 13:24:12 -08:00
lilia
30bca85f5a Fix undefined proto.source 2014-12-22 13:24:02 -08:00
lilia
ccc98d2f3d Fixup delivery receipts
Uses app-level timestamps for outgoing messages.
Adds timestamp property to the outgoing jsonData.
Triggers a runtime event to notify frontend on delivery receipts.
Renders delivered messages with a 'delivered' class.
2014-12-21 21:36:40 -08:00
lilia
348b5a53b1 Fixup OutgoingIdentityKeyError handling 2014-12-20 00:36:44 -08:00
lilia
3795ea5070 Fix message view using the wrong attribute 2014-12-19 17:59:23 -08:00
lilia
cfd4ccc803 Move index querying logic to /models 2014-12-19 17:59:18 -08:00
lilia
6cbde7894a Delivery receipts 2014-12-19 17:59:09 -08:00
lilia
1a4811fcef Fix tests 2014-12-19 17:39:40 -08:00
lilia
006653ed8e DB/Index Redux
This change removes the timestamp field from messages and conversations
in favor of multiple semantically named timestamp fields: sent_at,
received_at on messages; active_at on conversations. This requires/lets
us rethink and improve our indexing scheme thusly:

The inbox index on conversations will order entries by the
conversation.active_at property, which should only appear on
conversations destined for the inbox.

The receipt index will use the message.sent_at property, for effecient
lookup of outgoing messages by timestamp, for use in processing delivery
receipts.

The group index on conversation.members is multi-entry, meaning that
looking up any phone number in this index will efficiently yield all
groups the number belongs to.

The conversation index lets us scan messages in a single conversation,
in the order they were received (or the reverse order). It is a compound
index on [conversationId, received_at].
2014-12-19 17:39:40 -08:00
lilia
9c736df7d0 Handle incoming identity key changes
This ended up turning into a rewrite/refactor of the background page.
For best results, view this diff with `-w` to ignore whitespace. In
order to support retrying message decryption, possibly at a much later
time than the message is received, we now implement the following:

Each message is saved before it is decrypted. This generates a unique
message_id which is later used to update the database entry with the
message contents, or with any errors generated during processing.

When an IncomingIdentityKeyError occurs, we catch it and save it on the
model, then update the front end as usual. When the user clicks to
accept the new key, the error is replayed, which causes the message to
be decrypted and then passed to the background page for normal
processing.
2014-12-19 17:30:09 -08:00
lilia
5762e59c41 DRY up registration event callbacks
This was just a special case of the extension.on/trigger interface.
2014-12-19 14:02:52 -08:00
lilia
e68720f07f Frontend support for ReplayableErrors
Eventually we'll store errors on the message model, and this change will
let us render and process them.
2014-12-18 20:07:45 -08:00
lilia
4a401f07f3 Rewrite ReplayableErrors
ReplayableErrors make it easy for the frontend to handle identity key
errors by wrapping the necessary steps into one convenient little
replay() callback function.

The frontend remains agnostic to what those steps are. It just calls
replay() once the user has acknowledged the key change.

The protocol layer is responsible for registering the callbacks needed
by the IncomingIdentityKeyError and OutgoingIdentityKeyError.
2014-12-18 20:00:14 -08:00