Commit graph

43 commits

Author SHA1 Message Date
Scott Nonnenberg
0774ba2903 Eslintify all of libtextsecure 2018-07-21 14:52:43 -07:00
Scott Nonnenberg
5933a34a18 Use window.log in browser context, turn on console eslint rule 2018-07-21 14:52:43 -07:00
Scott Nonnenberg
a0ed993b42 Now we've got everything prettified! 2018-05-02 13:40:57 -07:00
Daniel Gasienica
95321e5d3e Remove Vim mode lines 2018-04-30 16:53:34 -04:00
Lilia
52cc8355a6 Feature: Blue check marks for read messages if opted in (#1489)
* Refactor delivery receipt event handler

* Rename the delivery receipt event

For less ambiguity with read receipts.

* Rename synced read event

For less ambiguity with read receipts from other Signal users.

* Add support for incoming receipt messages

Handle ReceiptMessages, which may include encrypted delivery receipts or read
receipts from recipients of our sent messages.

// FREEBIE

* Rename ReadReceipts to ReadSyncs

* Render read messages with blue double checks

* Send read receipts to senders of incoming messages

// FREEBIE

* Move ReadSyncs to their own file

// FREEBIE

* Fixup old comments on read receipts (now read syncs)

And some variable renaming for extra clarity.

// FREEBIE

* Add global setting for read receipts

Don't send read receipt messages unless the setting is enabled.
Don't process read receipts if the setting is disabled.

// FREEBIE

* Sync read receipt setting from mobile

Toggling this setting on your mobile device should sync it to Desktop. When
linking, use the setting in the provisioning message.

// FREEBIE

* Send receipt messages silently

Avoid generating phantom messages on ios

// FREEBIE

* Save recipients on the outgoing message models

For accurate tracking and display of sent/delivered/read state, even if group
membership changes later.

// FREEBIE

* Fix conversation type in profile key update handling

// FREEBIE

* Set recipients on synced sent messages

* Render saved recipients in message detail if available

For older messages, where we did not save the intended set of recipients at the
time of sending, fall back to the current group membership.

// FREEBIE

* Record who has been successfully sent to

// FREEBIE

* Record who a message has been delivered to

* Invert the not-clickable class

* Fix readReceipt setting sync when linking

* Render per recipient sent/delivered/read status

In the message detail view for outgoing messages, render each recipient's
individual sent/delivered/read status with respect to this message, as long as
there are no errors associated with the recipient (ie, safety number changes,
user not registered, etc...) since the error icon is displayed in that case.

*Messages sent before this change may not have per-recipient status lists
and will simply show no status icon.

// FREEBIE

* Add configuration sync request

Send these requests in a one-off fashion when:
  1. We have just setup from a chrome app import
  2. We have just upgraded to read-receipt support

// FREEBIE

* Expose sendRequestConfigurationSyncMessage

// FREEBIE

* Fix handling of incoming delivery receipts - union with array

FREEBIE
2017-10-04 15:28:43 -07:00
Scott Nonnenberg
7e8f3ab5e7
Fix for "Can't find record for undefined.1"
Also, we didn't need to recalculate the number here anyway!

FREEBIE
2017-08-04 15:23:54 -07:00
Scott Nonnenberg
e223db56d9 Set messageKeysLimit to unlimited if communicating with our devices (#1348)
Set messageKeysLimit to unlimited if communicating with our devices

FREEBIE
2017-08-04 12:25:30 -07:00
Scott Nonnenberg
224140c911 OutgoingMessage: Provide proper timestamp for replayability
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
5d1150e5bc Fix call to reloadDevicesAndSend - it returns a function
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
4ee4ad80c3 Message.send - check for missing identityKey, also add logging
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
551aa24e9a OutgoingMessage: A few code style tweaks to make things readable
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg
116e4d2eeb OutgoingMessage: Reduce the calls to registerError
In some cases, due to promise chaining and error propagation, we were
calling registerError more than once for a given error. This would then
cause the overall callback for the send operation to be called with a
partial set of errors, as well as duplicates.

Note: we do need to find a way to attach identityKey to the
OutgoingIdentityKeyError in the case where it comes directly from the
encrypt() instead of our pre-key operations.

FREEBIE
2017-08-04 12:03:25 -07:00
lilia
4232f5711c Handle identity key change errors on encrypt
We need to capture key change errors from the protocol library when we call
encrypt. Previously we would only see these on session init.

// FREEBIE
2017-08-04 12:03:25 -07:00
lilia
3afe378063 Remove legacy property from OutgoingMessage 2017-07-05 18:05:56 -07:00
lilia
d47ced1199 Don't recompute outgoing message padding
We can use the same padded plaintext across multiple numbers or attempts rather
than re-creating it every time we encrypt to a particular number.

// FREEBIE
2017-07-05 18:05:56 -07:00
lilia
30201969be Inline some functions in OutgoingMessage
Since we no longer have legacy messages to send, we can simplify things a bit
here.

// FREEBIE
2017-07-05 18:05:56 -07:00
lilia
e8548879db Stop sending legacy DataMessages 2017-06-20 17:57:27 -07:00
lilia
0fac2e1d68 Log when we see a 0 registrationId
Most likely an indicator that the device we're dealing with is a 3rd
party client.

// FREEBIE
2017-02-20 19:03:08 -08:00
haffenloher
d2ddfc72e4 Throw UnregisteredUserErrors in getKeysForNumber() 2017-02-08 17:13:36 -08:00
lilia
7c81e4ed2e Delete extra space 2016-10-05 21:15:58 +09:00
lilia
d11f9fd538 Update libsignal-protocol v1.1.4
// FREEBIE
2016-08-18 10:41:06 -07:00
lilia
167f19153c Update libsignal-protocol v1.1.0
Moves padding operations to the service library.

// FREEBIE
2016-06-14 19:30:26 -07:00
lilia
d89c3e8e86 Remove devices with no keys
// FREEBIE
2016-06-06 17:59:44 -07:00
lilia
89d3b772d5 Define UnregisteredUserError class
// FREEBIE
2016-05-25 20:20:10 -07:00
lilia
81dfdd959f Don't allow retry on unregistered user errors
// FREEBIE
2016-05-24 11:36:04 -07:00
lilia
055c0c323e Remove unneeded property from device object
// FREEBIE
2016-05-18 13:15:57 -07:00
lilia
58452066aa Move device storage methods to outgoing message
This is the only place they are called.

// FREEBIE
2016-05-18 13:15:56 -07:00
lilia
d32a352d8a Use deviceIds/addresses instead of encodedNumbers
The getDeviceObjectsForNumber method returns device objects that contain
nothing but the encodedNumber property. Instead, just deal in deviceIds
until a SignalProtocolAddress is constructed to manage both the number
and deviceId.

// FREEBIE
2016-05-18 13:15:55 -07:00
lilia
95935f70ee Remove relay check from sendmessage
We don't currently store any relay information about devices,
and

// FREEBIE
2016-05-18 13:15:55 -07:00
lilia
0483fa2f97 Remove closeOpenSessionForDevice from protocol_wrapper
// FREEBIE
2016-05-14 23:26:33 -07:00
lilia
891ddacd35 Remove processPreKey from protocol_wrapper
Use SessionBuilder directly instead of protocol_wrapper

// FREEBIE
2016-05-14 23:26:32 -07:00
lilia
843036f0ce Remove getRegistrationId and encryptMessageFor from protocol_wrapper
We can now use protocol classes like SessionCipher directly because it
supports per-device read/write serialization internally.

// FREEBIE
2016-05-14 23:26:31 -07:00
lilia
56238136ca Remove trivial wrapper method
// FREEBIE
2016-05-10 19:38:44 -07:00
lilia
78cdc0cb52 Remove tempKeys
Now that we simply establish and save a session via SessionBuilder
rather than saving the keys to pass in during encrypt, we can stop
caching them in memory in between the identity key check and the
encryption step.

// FREEBIE
2016-05-10 19:38:42 -07:00
lilia
9f871db48a Update libsignal-protocol / Update prekey format
Integrates change in prekey object formatting, which now matches more
conveniently with the representation rendered by the server.

// FREEBIE
2016-05-04 00:33:05 -07:00
lilia
b00d5289cf Save message timestamp for resending
Fix bug where resending due to failed network connection would fail
silently.

Broken in 7b6820 refactor which changed arguments to transmitMessage

// FREEBIE
2015-11-29 18:02:37 -08:00
lilia
5c37c3d6ce Change return type from sending messages
Pass the whole result from the outgoing message callback on to the
caller, and preserve the names of the members.

// FREEBIE
2015-11-24 17:05:25 -08:00
lilia
7b6820d2ac Refactor messageSender/OutgoingMessage
Move encrypt and transmit to OutgoingMessage
Restore per-number queueing to messageSender

// FREEBIE
2015-11-24 17:05:24 -08:00
lilia
a52d35bb1b Refactor and fixup key requests
Fix a bad loop scope bug in getKeysForNumber by using forEach.
Refactor the initial process of establishing key material for devices
that do not have open sessions.

// FREEBIE
2015-11-03 16:22:26 -08:00
lilia
b18cfd75de Check for device keys in memory before requesting more
// FREEBIE
2015-11-02 14:07:52 -08:00
lilia
2b9d039837 Serialize requests for keys
Fixes #383

// FREEBIE
2015-11-02 14:07:51 -08:00
lilia
01e85b68ef Handle exceptions when fetching keys for devices
It's rare that we get in a state where we have a device record without a
session, but we should handle errors gracefully in that case. Catch them
and register them, except for identity key errors which are registered
in handleResult.

// FREEBIE

fixup error handling // FREEBIE
2015-10-23 15:53:20 -07:00
lilia
12276e691b Refactor contents of sendMessageProto
This function dynamically declares a bunch of functions which bind to
its input arguments. Instead, use a new prototypal class to define
these functions within the context of a particular message.

// FREEBIE
2015-10-23 15:53:20 -07:00