Commit Graph

135 Commits

Author SHA1 Message Date
Scott Nonnenberg 1cc0633786
Full support for quotations in Android theme 2018-04-13 18:10:48 -07:00
Scott Nonnenberg 21bf02c94d
Fixed examples in Quote.md, rough Android visuals 2018-04-13 18:05:44 -07:00
Scott Nonnenberg 2def6afe45
message_view.js: eslint fixes and a bit of fixup 2018-04-13 18:05:43 -07:00
Scott Nonnenberg ae043bf239
In iOS theme, join attachment bubble with caption bubble 2018-04-13 18:05:42 -07:00
Daniel Gasienica ac50713f86 Improve auto-linking of URLs in messages
Fixes #598.
2018-04-11 16:36:42 -04:00
Daniel Gasienica 0c06fff47b Wire up `Message` / `Attachment` migration functions on startup
Makes `migrationContext` obsolete.
2018-03-26 16:38:34 -04:00
Daniel Gasienica ef2be2cf5f Make `MessageView::onUnload` synchronous
Our tests rely on that.
2018-03-26 16:38:34 -04:00
Daniel Gasienica b3251a8de2 Prevent potential NPE 2018-03-26 16:38:34 -04:00
Daniel Gasienica e1c1b1aa72 Load attachment data before rendering
Prevent double rendering of attachments by multiple entries into
`MessageView::render` using promises.
2018-03-26 16:38:34 -04:00
Daniel Gasienica 97e3b49a36 Whitelist `js/views/message_view.js` for ESLint 2018-03-26 16:38:34 -04:00
Daniel Gasienica b5721c2594 Remove Vim modeline 2018-03-26 16:38:34 -04:00
Scott Nonnenberg 72b7e4ec34
Process expireTimer and block status along with contact/group sync (#1980)
* Mark group as left = false if it is active in contact sync

* Handle expireTimer + blocked state along with contact/group sync
2018-01-29 18:14:39 -08: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
Lilia ae190fed44
Profiles (#1453)
* Add AES-GCM encryption for profiles

With tests.

* Add profileKey to DataMessage protobuf

// FREEBIE

* Decrypt and save profile names

// FREEBIE

* Save incoming profile keys

* Move pad/unpad to crypto module

// FREEBIE

* Support fetching avatars from the cdn

// FREEBIE

* Translate failed authentication errors

When AES-GCM authentication fails, webcrypto returns a very generic error. The
same error is thrown for invalid length inputs, but our earlier checks in
decryptProfile should rule out those failure modes and leave us safe to assume
that we either had bad ciphertext or the wrong key.

// FREEBIE

* Handle profile avatars (wip) and log decrypt errors

// FREEBIE

* Display profile avatars

Synced contact avatars will still override profile avatars.

* Display profile names in convo list

Only if we don't have a synced contact name.

// FREEBIE

* Make cdn url an environment config

Use different ones for staging and production

// FREEBIE

* Display profile name in conversation header

* Display profile name in group messages

* Update conversation header if profile avatar changes

// FREEBIE

* Style profile names small with ~

* Save profileKeys from contact sync messages

// FREEBIE

* Save profile keys from provisioning messages

For standalone accounts, generate a random profile key.

// FREEBIE

* Special case for one-time sync of our profile key

Android will use a contact sync message to sync a profile key from Android
clients who have just upgraded and generated their profile key. Normally we
should receive this data in a provisioning message.

// FREEBIE

* Infer profile sharing from synced data messages

* Populate profile keys on outgoing messages

Requires that `profileSharing` be set on the conversation.

// FREEBIE

* Support for the profile key update flag

When receiving a message with this flag, don't init a message record, just
process the profile key and move on.

// FREEBIE

* Display profile names in group member list

* Refresh contact's profile on profile key changes

// FREEBIE

* Catch errors on profile save

// FREEBIE

* Save our own synced contact info

Don't return early if we get a contact sync for our own number

// FREEBIE
2017-09-14 17:04:00 -07:00
Scott Nonnenberg e3bada1f4a
MessageView.updateColor: Call getAvatar on convo, not message
FREEBIE
2017-09-07 10:38:00 -07:00
Scott Nonnenberg 4009a0119e MessageView: Handle change of color to null, call getColor() (#1438)
When we relied on the actual value of the color property to be supplied
to the updateColor change event listener, sometimes it would be null.
Then the conversation bubbles would have no color at all, making the
text hard to read.

FREEBIE
2017-09-06 18:19:11 -07:00
Scott Nonnenberg 82b2a611e3 MessageView: Always remove errors on re-render to prevent doubles
FREEBIE
2017-08-07 16:14:49 -07:00
Scott Nonnenberg 65283d2794 Unload conversations and old messages every half-hour
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 4124d5cb9b Show 'Message not sent' only if 'Some recipients failed' not showing
Also switch up the visual style for 'Some recipients failed' text to
match the more-visible 'Message not sent' text and the 'Resend' link.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg ff4fde651c Make it clear in conversation just some recipients failed
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 30bc3fca3a MessageView: Be resilient to multiple renders of a network error
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 1e8ae774a2 Differentiate between local and remote trust decisions
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 11372b4e00 Add icons for keychange and expiration timer in-conversation items
The shield matches the Android app's key change notification, and the
clock icon was easy to do and makes it easier to visually distinguish
those items in the conversation history.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg c714fb6dbf Shadow/icon/blue for banner, better verify advisories in dark theme
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 9b864c8675 Re-render verified change conversation items when convo changes
If the contact's name changes, for example.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 1cf9289b1a Add items to conversation history when user verifies/unverifies
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg ae3587f05e Move all instances of 'verify identity' to 'show identity'
As discussed in standup this morning - only the act of verifying or a
statement about current status should use that word 'verify.'

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 24174312b9 Fix: Show attachment views; they trigger update syncrhonously
FREEBIE
2017-06-16 10:52:57 -07:00
Scott Nonnenberg 2b5e56f6be Use setElement to ensure that re-parented views listen for events
FREEBIE
2017-06-15 16:28:15 -07:00
Scott Nonnenberg 40651f44ab
MessageView.appendAttachmentView: Remove from proper parent
FREEBIE
2017-06-08 19:59:22 -07:00
Scott Nonnenberg f38d8eb4ae Fix: Ensure that attachments are always rendered
Because we only attach AttachmentViews to the DOM when they fire their
'update' event, we were subject to a race condition. If that event fired
after the final Message.render(), then it would be properly attached to
the final DOM node. If it fired early, it would end up missing from
the visible DOM entirely, attached to the old, discarded version of
the message.

This change updates our handling of a second call to loadAttachments().
Instead of bailing out if we've been called before, we attempt to
re-add our child AttachmentViews to the current DOM. But only if the
'update' event has been fired, and if their current parent node is not
what is in the DOM.

FREEBIE
2017-06-07 15:28:30 -07:00
Scott Nonnenberg bb483474a3 Fix: Show hourglass on incoming disappearing messages once read
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg 9a09e7a16b TimerView: Update only as often as 500ms
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg 5351b60365 TimerView: Remove some unused bits of code
- initialize doesn't need to call update because
  MessageView.renderExpiring() calls it immediately
- we don't need the className because that's already present on
  the el it attaches to, part of the MessageView's template.

FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg fb7e7cf34c TimerView: don't continue to update after expiration
FREEBIE
2017-06-06 15:33:55 -07:00
Scott Nonnenberg eb1a4b3ac6 loadAttachments: Handle the zero -> some attachments case
FREEBIE
2017-06-01 15:38:26 -07:00
Scott Nonnenberg 0e1b534d3c Make MessageView.render() idempotent
Re-renders happen when we re-fetch messages from the database, and our
previous technique for loading attachments resulted in a new attachment
view added for every call to render()

This change ensures that a second call to render() does not add any more
attachment views.

FREEBIE
2017-06-01 15:38:26 -07:00
lilia e4b9c51f88 Rework expiring messages management
// FREEBIE
2017-02-22 16:18:01 -08:00
lilia cd0fe7037b Add replayable error for signed key failure
Disable message sending if signed key updates fail too many times, but
allow the user to retry sending.

// FREEBIE
2017-02-16 18:06:19 -08:00
lilia a623f909f2 Move key change advisory content to the model
Return this content from a helper method so it can be used to populate
the last message on conversations.
2017-01-25 20:40:25 -08:00
lilia 260f50c104 Add id attr to key change advisory elements
The id attribute is needed to ensure that message elements are inserted
in the correct place in the DOM
2017-01-25 20:40:25 -08:00
lilia 41216f1378 Add timestamps to attachment filenames 2017-01-25 20:40:24 -08:00
lilia 35270dbbb4 Use timeout-based animation for hourglasses
CSS animations are convenient but costly if you have hundreds of them.

Fixes #945
2016-10-30 16:53:17 +09:00
lilia 657fa2725f Adjust hourglass vertical alignment 2016-10-11 22:52:40 +09:00
lilia fcffcd35af DRY 2016-10-07 09:29:53 +09:00
2-4601 81e1b84129 Fix 2nd person conjugation in exp. timer messages
// FREEBIE
2016-10-07 09:25:19 +09:00
lilia 4ee2652367 Fix wrong contact in some timer updates
Mistakenly showed 'You' for timer updates inferred from incoming
messages.
2016-10-05 22:31:30 +09:00
lilia 7fe708d195 Insert keychange advisories
On click, these open a verification panel for the relevant contact,
within this conversation.

// FREEBIE
2016-10-05 19:11:39 +09:00
lilia de744a6c55 Fix messages being inserted in the wrong place
Usually new elements are inserted in a predictable order relative to the
sort order of the models/collection, but it's not garaunteed. This fixes
up message element insertion to handle the general case where elements
can be added in any order and must be displayed in correct order as
determined by the collection's sort function. In the worst case, we'll
have to iterate over the entire list of elements to find the right spot,
but in practice most of the time we can short circuit based on the index
of the model or by looking for the predecessor or successor of the
element in question.
2016-10-05 19:09:21 +09:00
lilia 0bba096510 Use 'You' instead of your own phone number 2016-10-05 19:09:20 +09:00