Commit Graph

2006 Commits (3dc3667b4577bb51e9592184421bcce144b36b5e)

Author SHA1 Message Date
Scott Nonnenberg 4f90cefd4f More bullet-proofing - reject surrounding promise if save() fails
FREEBIE
8 years ago
Scott Nonnenberg 1eb450ca35 Conversation: Start w/DEFAULT verified state, avoid null timestamp
Fix too-aggressive verification notifications on startup by starting a
conversation with the right initial verified state, and then making sure
to fetch() before setting a new verified state.

FREEBIE
8 years ago
Scott Nonnenberg bd0050b6c6 Cache messages on receipt, remove from cache when processed
FREEBIE
8 years ago
Scott Nonnenberg e6859a3684 Ensure that promises always resolve, or that rejections are okay 8 years ago
Scott Nonnenberg 4da1722ee8 Bullet-proof _setVerified and handleDataMessage against rejections
And the weird behavior we get from $.Deferred.

FREEBIE
8 years ago
Scott Nonnenberg 5da324103a Throttle calls to getProfile when opening conversation
We don't want to throttle other calls to getProfile, so we localize this
to the fetch we do when we first open a conversation.

FREEBIE
8 years ago
Scott Nonnenberg aa80cdd74d ConfirmationDialogView: Make showCancel an explicit option
Also, don't call resolve/reject callbacks if they weren't provided.

FREEBIE
8 years ago
Scott Nonnenberg 14765599f3 Delete individual message
FREEBIE
8 years ago
Scott Nonnenberg 80a2a01e37 Remove jitter on verifying/unverifying safety number
On every click, even when sub-panes were open, we were calling
markRead(), which would save the conversation model with the new
unreadCount. The KeyVerificationPanelView was wired up to the change
event on conversation, so it would render with the results of that
update, then finally the user's intended update.

FREEBIE
8 years ago
Scott Nonnenberg 12b2674bde Show size of files even if size not precomputed for attachment
FREEBIE
8 years ago
Scott Nonnenberg 9ba5aaa54d Verification sync logging: include whether it was from contact sync
FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg 25243ad9de Send warning: Show single problematic group member, not group name
FREEBIE
8 years ago
Scott Nonnenberg 697079cf9b Add else handlers with logging in toggleVerified catch handler
FREEBIE
8 years ago
Scott Nonnenberg 8112cd220a Show warning when we discover key change on verify
FREEBIE
8 years ago
Scott Nonnenberg 91f50c028f Unify processVerifiedMessage with Java implementation
This removes our support for the New Key/DEFAULT case, which iOS will
sync to us. Why? Because it ensures that in out of date scenarios, we
don't lose the higher-security state we were in previously.

FREEBIE
8 years ago
Scott Nonnenberg 5bba6d3f17 setTrusted() -> setApproved() to dismiss the five-second warning
This change makes sense, since there was already a reference in the code
to the then-nonexistent setApproved()!

FREEBIE
8 years ago
Scott Nonnenberg 23a806a6b1 removeAllSessions: properly reject in failure cases
FREEBIE
8 years ago
Scott Nonnenberg 7ab20f09cc Fix focus issues with identity key send view
Tabbing right after entering the view would cause everythign to go crazy
as focus went back to the pane you were just on. This change both sets
the proper focus on load of that view (on the cancel button) and hides
other panes when they aren't active, only making them visible again when
they are once again the 'top' pane.

FREEBIE
8 years ago
Scott Nonnenberg ff4fde651c Make it clear in conversation just some recipients failed
FREEBIE
8 years ago
Scott Nonnenberg 12914307f1 Improve experience when discovering identity key error on send
New experience in the Message Detail view when outgoing identity key
errors happen, matching the Android View.

'View' button is only shown on outgoing key errors right now.

When a contact with an outgoing identity key error is clicked, they are
taken to a view like the popup that comes up on Android: an explanation
of what happened and three options: 'Show Safety Number', 'Send Anyway',
and 'Cancel'

Contacts are now sorted alphabetically, with the set of contacts with
errors coming before the rest.

FREEBIE
8 years ago
Scott Nonnenberg b6cca41a0c Update verification-related strings to better match mobile app
FREEBIE
8 years ago
Scott Nonnenberg f654532fa8 Handle UNVERIFIED sync verification messages (via contact sync)
FREEBIE
8 years ago
Scott Nonnenberg 20451cc827 Show verified/keychange notifications when actually relevant
FREEBIE
8 years ago
Scott Nonnenberg e91f2d0377 Miscellaneous wire-up to ensure that failures propagate
FREEBIE
8 years ago
lilia aa83bc1dab Ensure all sessions are archived on profile fetch
If the key has changed, saveIdentity will archive sibling sessions, but not the
session for the device it was called on. Therefore we have to archive that one
by hand.

Also switch from saving the identity of an OutgoingIdentityKeyError to just
triggering a profile fetch, mostly for consistency, simplicity, and DRYness.

// FREEBIE
8 years ago
lilia 3206536d47 Fix deadlock in saveIdentity
Archive only sibling sessions so as not to block on the same device lock as the
protocol lib.

// FREEBIE
8 years ago
lilia e5e4eab9c5 Add archiveSiblingSessions
// FREEBIE
8 years ago
lilia 982e7f962c Update libsignal-protocol
// FREEBIE
8 years ago
Scott Nonnenberg e2ee63efaa m.get('sender') -> m.isIncoming(), filter in getLoadedUnreadCount
FREEBIE
8 years ago
Scott Nonnenberg 5b46ef3562 Show last seen indicator for keychange/verification notifications
FREEBIE
8 years ago
Scott Nonnenberg 1fedc75e5d Handle unverified length of zero
This can happen with unknown groups, where we don't know the list of
members but we're receiving messages. It's generally not a good
experience, but we shouldn't crash.

FREEBIE
8 years ago
Scott Nonnenberg 224140c911 OutgoingMessage: Provide proper timestamp for replayability
FREEBIE
8 years ago
Scott Nonnenberg 5d1150e5bc Fix call to reloadDevicesAndSend - it returns a function
FREEBIE
8 years ago
Scott Nonnenberg f414c13220 Protos: Update to optional verified in sync (was: repeated)
This means that we no longer need to iterate.

FREEBIE
8 years ago
lilia fdce4cfc7c Fix failed identity key sync from contact sync
These were failing because ByteBuffers from the protobufs need to be converted
to ArrayBuffers. Fixed by useing the existing handler in MessageReceiver to
process verified messages from contact sync messages and dispatch them as their
own events, reducing some complexity on the application side.

// FREEBIE
8 years ago
Scott Nonnenberg 78094102bd Message.send: Add promise to array for consistency
FREEBIE
8 years ago
Scott Nonnenberg 4ee4ad80c3 Message.send - check for missing identityKey, also add logging
FREEBIE
8 years ago
Scott Nonnenberg 551aa24e9a OutgoingMessage: A few code style tweaks to make things readable
FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg 30bc3fca3a MessageView: Be resilient to multiple renders of a network error
FREEBIE
8 years ago
Scott Nonnenberg 5e62d0cfd8 Update identity key after a send error tells us it has changed
FREEBIE
8 years ago
Scott Nonnenberg 22208ec3f8 Fix: Conversation.updateVerified fails when convo not yet in db
FREEBIE
8 years ago
lilia 9f4fcc5afa Send null messages to mask verified syncs
First construct a null message of random size and contents and send it to the
destination. Then include that same padding in the verification sync.

Note that the sync message is additionally randomly padded like all other sync
messages.

This lets Verified sync messages appear the same as normal sync message traffic.

// FREEBIE
8 years ago
lilia bb9c97b960 Support for receiving null messages
Just log em for debugging. Also update the error messge thrown when we get a
content message with no supported properties. It may be empty or may just have
an unrecognized field.

// FREEBIE
8 years ago
lilia 243fd68904 Handle verified state from contact syncs
Treat it just like an isolated verified state sync

// FREEBIE
8 years ago
lilia 1e93b12b90 Update protos with support for null messages
// FREEBIE
8 years ago
lilia 6e758fc1ea Randomly pad all sync messages
WhisperSystems/libsignal-service-java@c46cdc0aa5

// FREEBIE
8 years ago
Scott Nonnenberg 7bfb66b13b processVerifiedMessage: Archive all sessions when key changes
FREEBIE
8 years ago
Scott Nonnenberg 827addf628 Log on receipt of verified sync after we've processed the state
FREEBIE
8 years ago
lilia d7054f4b63 Archive sessions whenever an identity key changes
Sessions established with the previous identity should no longer be used for
sending, so we should close them.

Since we've added this call to saveIdentity, we can omit the call to it after
profile fetches.

// FREEBIE
8 years ago
Scott Nonnenberg 0056cbefc1 processVerifiedMessage: Trigger keychange event when key differs
FREEBIE
8 years ago
Scott Nonnenberg 0db2ef9e7f Refactor: combine Conversation.setVerified/setVerifiedDefault
FREEBIE
8 years ago
Scott Nonnenberg d1fa28b706 Object.assign -> _.extend(), for to make Chrome 45 and below work
FREEBIE
8 years ago
Scott Nonnenberg 1e8ae774a2 Differentiate between local and remote trust decisions
FREEBIE
8 years ago
Scott Nonnenberg 20f4d48991 Protos: Move to latest iteration of verification protos
FREEBIE
8 years ago
lilia 3acfda3a56 Archive sessions on key changes after profile fetch
// FREEBIE
8 years ago
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
8 years ago
lilia 4f2f622598 Apply special handling to verification sync messages
// FREEBIE
8 years ago
lilia 1614a6f1b8 Add special handling for verification sync
processVerifiedMessage checks the current state of the database against the
identity key from an incoming verification sync message to determine whether or
how to update our local record.

When syncing a DEFAULT status and we have no local record, it's a no-op, but
we'll log it.

When syncing a DEFAULT status and we have non-default record with the same key,
mark it as default.

When syncing a VERIFIED status and either:
  1. we have no key on record,
  2. we have have a different key on record, or
  3. we have the same key on record, but not verified
mark it as verified.

Otherwise do nothing.

References: https://github.com/WhisperSystems/Signal-Android/blob/master/src/org/thoughtcrime/securesms/util/IdentityUtil.java#L129

// FREEBIE

Ensure processVerified resolves
8 years ago
lilia c60919ca0e Update setVerified to take an optional key argument
If specified, the existing local key must match the given one or we will not
update the record.

// FREEBIE
8 years ago
Scott Nonnenberg 16433d661a Show call to action on group member list when verifying
FREEBIE
8 years ago
Scott Nonnenberg 31bf05e14a Add verified state summary to top of safety number screen
FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg c714fb6dbf Shadow/icon/blue for banner, better verify advisories in dark theme
FREEBIE
8 years ago
Scott Nonnenberg 1d7cbc14fd Fix a couple bind()) issues when getting verified state
FREEBIE
8 years ago
Scott Nonnenberg b0dbecb4e2 Check trust store for identity key information on every new message
It's debounced so it doesn't go too crazy.

FREEBIE
8 years ago
Scott Nonnenberg 782c484680 Check trust store for latest identity key info before sending
We definitely want the latest information from our local database before
attempting to send.

FREEBIE
8 years ago
Scott Nonnenberg fc39241003 Ensure that we pull verified state only after getting profiles
FREEBIE
8 years ago
Scott Nonnenberg 4a1dc46ab3 Fixes to get local verification and sync messages working
FREEBIE
8 years ago
Scott Nonnenberg c43d96904d Move to the real verify/trust APIs
This wires up verification sync messages, verification and trust checks
to the trust store instead of using mocked data.

FREEBIE
8 years ago
lilia 52481d1d13 Support for sending and receiving verification sync messages
This adds a new method to message sender for sending verification sync messages
and a new event to message receiver representing incoming verification sync
messages. Currently the event handler just logs the message.

// FREEBIE
8 years ago
Scott Nonnenberg 475d607fd0 Prepare for verification sync messages: receiver, ready to send
FREEBIE
8 years ago
Scott Nonnenberg aebf4b32d6 Conversation.updateLastMessage: fix indent, use of null message
FREEBIE
8 years ago
Scott Nonnenberg 36c28296e9 Remove extraneous logging
FREEBIE
8 years ago
Scott Nonnenberg 9b864c8675 Re-render verified change conversation items when convo changes
If the contact's name changes, for example.

FREEBIE
8 years ago
Scott Nonnenberg 1cf9289b1a Add items to conversation history when user verifies/unverifies
FREEBIE
8 years ago
Scott Nonnenberg a827334c3e Allow re-send of messages in msg detail view on OutgoingKeyError
We also show more errors than we used to in the MessageDetail screen
to help make it clear what is happening, and why the user would need to
re-send.

FREEBIE
8 years ago
Scott Nonnenberg 688cae6374 Remove empty string class passed to contact template
FREEBIE
8 years ago
Scott Nonnenberg 8264f3ba33 Make the term 'Verified' fully localizable
FREEBIE
8 years ago
Scott Nonnenberg e9968c3118 Remove comments after NewGroupUpdateView investigation
It doesn't run today - it depends on RecipientsInputView, which depends
on Backbone.TypeaheadCollection which doesn't currently exist in the
product.

FREEBIE
8 years ago
Scott Nonnenberg 8d29cb9830 Prevent access to Safety Number when talking to yourself
FREEBIE
8 years ago
Scott Nonnenberg c7e385eb38 Remove 'safety number approval' option from settings dialog
Also sync templates in test/index.html and background.html

FREEBIE
8 years ago
Scott Nonnenberg 9204188aa3 A bit of cleanup after some early code review
FREEBIE
8 years ago
Scott Nonnenberg 2955c36b3e Confirmation dialog: Make keyboard-accessible: escape to cancel
And proper tab order. Then some more work to re-focus on the message
composition field after the dialog shows up and steals focus.

FREEBIE
8 years ago
Scott Nonnenberg 243cbd8123 Confirmaton on send, banner when 'unverified'
Not yet using the new APIs, but ready to. Still to do:
- Send sync messages on trust decisions
- Respond to received trust decision sync messages
- Show trust decisions in the conversation history
- In that rare situation where a sent message ends up with a key error
  make it easy to retry the send.

FREEBIE
8 years ago
Scott Nonnenberg bedf10056b Support for group-member verifications via second-level panel
Also:
- All the necessary wire-up to update things in real time. If you have
a safety number page up via a group member view as well as via a 1:1
conversation with that contact, they'll both be updated as the
underlying model changes. Similarly, the overall group will update
in real-time as members change.
- A bit of special-casing for yourself in a group conversation - you're
shown as 'me' and are not clickable, where normally that would take you
to the Safety Number screen for that contact. You are also not included
in the trust calculations for a given group.

FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg ee0b0f5ffb Remove all concept of 'key conflict' from the app 8 years ago
lilia 0e0f14723e Rename model IdentityKey -> IdentityRecord
Reduce ambiguity in between the record itself, which now stores other
information besides the public key, and its `publicKey` attribute, which
contains an ArrayBuffer of key material.

This model is internal to SignalProtocolStore.

// FREEBIE
8 years ago
lilia aa6dbb2e59 Preserve UNVERIFIED status on key change
Don't revert it to default, which would effectively downgrade the security model
for that contact.

// FREEBIE
8 years ago
lilia 12d9bb61c3 Let removeIdentityKey delete the entire record
Previously we would only clear the publicKey since that was the only attribute,
but now we should delete the entire record. This method is currently only called
from tests.

// FREEBIE
8 years ago
lilia d1858de39b Default nonblockingApproval to false
saveIdentity is invoked with only two arguments from the protocol layer, in
which case we should default nonblockingApproval to false.

76c28cfa7a/src/org/thoughtcrime/securesms/crypto/storage/TextSecureIdentityKeyStore.java (L87)

// FREEBIE
8 years ago
lilia 261ec003ee Account manager calls saveIdentityWithAtttributes
saveIdentityWithAtttributes allows directly setting all properties of an
identity key record. In AccountManager we use it to save our own identity
key after a new registration.

Previously we would remove the existing key first in order to coerce firstUse to
true, but now we can simply set it explicitly, along with a VERIFIED status.

// FREEBIE
8 years ago
lilia 2a76bb6fc2 Add new methods to identity store
// FREEBIE
8 years ago
lilia 50dd9c6772 Add identityKey model validation
This will enforce that all identity record attributes are valid and present
before allowing the record to be saved. This is necessary since we will be
exposing a lower-level method to save an identity with explicit values for
firstUse, nonblockingApproval, and verified status.
8 years ago
lilia b93042f12f Add verified status
// FREEBIE
8 years ago
lilia c6bfdec84d Remove blockingApproval
// FREEBIE
8 years ago
lilia 53e7e1be3a Fix libsignal-protocol using wrong direction flag
// FREEBIE
8 years ago
lilia 6fdd0f1625 Handle identity errors on decrypt
Previously we only expected these errors to occur when decrypting prekey
messages, so we need to add handling for them in the case of a normal message.

// FREEBIE
8 years ago
lilia f095a1583e Fetch profiles whenever conversations are opened
For a group, fetch everyone's profile.

// FREEBIE
8 years ago
lilia d295fa7057 Update libsignal-protocol
// FREEBIE
8 years ago
lilia 1b9eb83422 Update isTrustedIdentity for directional trust
// FREEBIE
8 years ago
lilia 4e4aedd4ba Pass in non/blockingApproval args to saveIdentity
Multiple cases here:
1. setting our own key on registration
1. changing identities from a safety number change dialog

Note that removeIdentityKey runs before saveIdentity, so we'll always end up
with firstUse: true on our own key.

// FREEBIE
8 years ago
lilia 3ca511a10a Unwrap removeIdentityKey from calls to saveIdentity
saveIdentity is now reponsible for determining firstUse, so we must not remove
the existing key before updating it.

Previously, the implementation provided an extra check against overwritting an
existing key, but that should be done via isTrustedIdentity instead.

// FREEBIE
8 years ago
lilia 82469713d2 Update saveIdentity
Add support new blockingApproval and nonblockingApproval arguments
Populate the firstUse property on identity key records
Return whether an existing record was overwritten.

References
https://github.com/WhisperSystems/Signal-Android/commit/39d4a7#diff-69ede72c549da6bcbcd959935995b7e9R45

// FREEBIE
8 years ago
lilia 4d4dd3341f Add isBlocking/isNonBlockingApprovalRequired
These analyse the identity key record and user preferences to determine whether
a key requires approval for sending.

// FREEBIE
8 years ago
lilia 22e907a8d4 Add getProfile to MessageSender
// FREEBIE
8 years ago
lilia 0c5a69cce4 Add support for getProfile to TextSecureServer
// FREEBIE
8 years ago
lilia 9f4a657e8a Add database migration
// FREEBIE
8 years ago
lilia 3afe378063 Remove legacy property from OutgoingMessage 8 years ago
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
8 years ago
lilia 30201969be Inline some functions in OutgoingMessage
Since we no longer have legacy messages to send, we can simplify things a bit
here.

// FREEBIE
8 years ago
lilia e8548879db Stop sending legacy DataMessages 8 years ago
Scott Nonnenberg 3fbd1ab618 Use error.stack instead of error for console log
Chrome/V8 give you the error name, message and callstack at that
property, where toString() gives you [object NavigatorUserMediaError]

FREEBIE
8 years ago
Scott Nonnenberg 98f88607a0 Remove recorder UI when we fail to 'getUserMedia'
FREEBIE
8 years ago
Scott Nonnenberg 24174312b9 Fix: Show attachment views; they trigger update syncrhonously
FREEBIE
8 years ago
Scott Nonnenberg 2b5e56f6be Use setElement to ensure that re-parented views listen for events
FREEBIE
8 years ago
Scott Nonnenberg 40651f44ab
MessageView.appendAttachmentView: Remove from proper parent
FREEBIE
8 years ago
Scott Nonnenberg f602ac462f A little cleanup in ConversationView.resetLastSeenIndicator
FREEBIE
8 years ago
Ikarulus 1021f835fe changes due to feedback 8 years ago
Ikarulus 068cf5092c fix typo 8 years ago
Ikarulus ec3278ca3a add message length warning for android clients 8 years ago
Scott Nonnenberg d269751dbc Conversation.markRead: Return a promise so queueJob works
FREEBIE
8 years ago
Scott Nonnenberg 785b117b86 Mark older messages as read when we get out-of-order read receipt
FREEBIE
8 years ago
Scott Nonnenberg aeefc530d2 Conversation.markRead: Remove checks for unread
We will now always attempt to mark things unread if this method. If the
conversation's unreadCount gets out of date, set to zero, we will still
do it. If we go through the motions, and nothing is newly marked read,
we will still set the unreadCount to zero.
8 years ago
Scott Nonnenberg 6fbdd63e7e Conversation.onReadMessage - queue job, don't send read receipts
We queue the job because we often get a whole lot of read receipts at
once, and their markRead calls could very easily overlap given the async
pull from DB.

We also disable read receipts for any message marked read due to a read
receipt. That's a notification explosion we don't need.

FREEBIE
8 years ago
Scott Nonnenberg 89046484ed Read receipts: Also mark all messages read prior to this one
We mark as read everything older than this message - to clean up old
stuff still marked unread in the database. If the user generally doesn't
read in the desktop app, so the desktop app only gets read receipts, we
can very easily end up with messages never marked as read (our previous
early read receipt handling, read receipts never sent because app was
offline).

FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg da8d49b5ed ConversationView.markRead: Mark all messages read when at bottom
To handle the same 'not quite at the bottom' case that our 30px buffer
gives us for marking messages read, we use the same atBottom() method to
determine whether we should mark everything unread. Saves the effort and
potential missed messages (due to partial pixels, etc.).

FREEBIE
8 years ago
Scott Nonnenberg 6bfeb7ab14 Conversation.sendMessage: Don't set unreadCount to zero
This is no longer guaranteed to be true. If you're scrolled up in a
conversation, you may not have read all messages. Setting the
unreadCount to zero will prevent the user from marking any of their
existing messages as unread until something else happens, like receiving
a read receipt or new message.

FREEBIE
8 years ago
Scott Nonnenberg bb483474a3 Fix: Show hourglass on incoming disappearing messages once read
FREEBIE
8 years ago
Scott Nonnenberg 9a09e7a16b TimerView: Update only as often as 500ms
FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg fb7e7cf34c TimerView: don't continue to update after expiration
FREEBIE
8 years ago
Scott Nonnenberg 0c2c36c11a loadMoreMessages: Fix broken reference to this.view.outerHeight
:0/

FREEBIE
8 years ago
Ikarulus ab5489baa0 fixed #1163, dark theme flaw 8 years ago
Scott Nonnenberg ec22445f75 Bulletproofing of markRead and findNewestVisibleUnread
FREEBIE
8 years ago
Scott Nonnenberg 1775e97bcd Add comment and fine-tune last-seen indicator when not focused
FREEBIE
8 years ago
Scott Nonnenberg 672a517b73 Preserve lastSeenIndicator location when not focused
Also, a couple name changes of ConversationView methods to better
reflect what they do. update -> reset, since the method is destructive.

FREEBIE
8 years ago
Scott Nonnenberg 944ae296eb Prevent 'mark read on scroll' during fetches
FREEBIE
8 years ago
Scott Nonnenberg b60b20bde4 Mark messages read only when visible, on receipt, focus, scroll
- Only mark messages read when scrolling if in focus and visible
- Remove last seen indicator when scrolling to the bottom with scroll
  down button
- Update last seen indicator when we don't already have one and we're
  scrolled up.

FREEBIE
8 years ago
Scott Nonnenberg 9a0a87ab40 Last seen indicator: dismissed only on open and send
It can be moved if you're not scrolled to the bottom of of the window
or the window doesn't have focus when a new message comes in. Other than
that, it marches up the window until you close and reopen the
conversation, or send a message.

Note that we do NOT mark messages as read if they come in when you are
scrolled up. But we do mark the entire conversation as read if you
switch away from the app and back.

FREEBIE
8 years ago
Scott Nonnenberg eb1a4b3ac6 loadAttachments: Handle the zero -> some attachments case
FREEBIE
8 years ago
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
8 years ago
Scott Nonnenberg 25ebcc3131 Fix broken reference to i18n string 'mediaMessage'
FREEBIE
8 years ago
Scott Nonnenberg 0b6d5de753 Update the scroll position when 'fetch more messages' is complete
FREEBIE
8 years ago
lilia 3dbb21c53c Fix being re-added to a group you previously left
Negate the flag marking the group as left. Fixes #1207.

// FREEBIE
8 years ago
Scott Nonnenberg 13a91eece8 MessageListView.measureScrollPosition: reuse variables 8 years ago
Scott Nonnenberg c5530b7235 Increase wiggle room to 30 px, which should ensure text cut off
FREEBIE
8 years ago
Scott Nonnenberg 84397a2ef4 20px at bottom of conversation considered 'at the bottom'
So users who are 'close enough' at the bottom of the conversation won't
get marooned in history.

FREEBIE
8 years ago
Scott Nonnenberg 09791ab7d9 Make last seen indicator more stable, with less forced removal
FREEBIE
8 years ago
Scott Nonnenberg c3dc9732ef Fix: Don't scroll to last seen indicator on focus
FREEBIE
8 years ago
Scott Nonnenberg 10c2874d19 Fix race condition: Pull from database after add to conversation
Also add some console logs to help us determine whether this ever
happens to people in the wild.

FREEBIE
8 years ago
Scott Nonnenberg 9de384f3b8 Reset last seen indicator timing on focus of window
FREEBIE
8 years ago
Scott Nonnenberg 01918049b4 Keep last seen indicator around for five seconds
Helps calm the user experience a little more, makes it easier to
understand what's happening when messages are coming in quickly.

FREEBIE
8 years ago
Scott Nonnenberg 4e9e811d12 Last seen indicator: Keep scroll position when window loses focus
FREEBIE
8 years ago
Scott Nonnenberg 3beecce94e fetchConversation: Minimize scans across loaded messages
FREEBIE
8 years ago
Scott Nonnenberg d5d1d58cc2 Exclude Backbone-sourced method from jscs checks
FREEBIE
8 years ago
Scott Nonnenberg 3ceb3a049e Override Message.fetch to ensure that db data overrides local
FREEBIE
8 years ago
Scott Nonnenberg 2c81539042 A guard to prevent infinite loops in fetching of conversation
FREEBIE
8 years ago
r-clancy 66b19d5cf7 Add support for opening the inbox via a shortcut - fixes #1134. 8 years ago
Scott Nonnenberg fdf04f6229 Ensure that we never show last seen indicator if count is zero
FREEBIE
8 years ago
Scott Nonnenberg e023c58883 Update last seen indicator even if window doesn't have focus
FREEBIE
8 years ago
lilia 72019eb79c Reuse a variable
FREEBIE
8 years ago
lilia 176339ffe6 Add log to see if we ever fetch while fetching
// FREEBIE
8 years ago
lilia 16f3717824 Move refresh prekeys out of SignalProtocolStore
Use an event/listener instead

// FREEBIE
8 years ago
lilia 017bb56cca Fix some corner casese with last seen indicator
* Remove increment behavior
* Dismiss when new messages arrive but the window is focused
* Update the indicator when window becomes focused.

// FREEBIE
8 years ago
Scott Nonnenberg bb468e7b01 Wait for scroll before deciding whether to add scroll down button
FREEBIE
8 years ago
Scott Nonnenberg 30b7bf23db Recursively fetch messages until we've loaded all unread
FREEBIE
8 years ago
Scott Nonnenberg 8b4402e8a5 Only show scroll down button if we're not at bottom of convo
FREEBIE
8 years ago
Scott Nonnenberg 4c7bfbe9ff Scroll down button: when scrolled up, or new non-visible message
FREEBIE
8 years ago
Scott Nonnenberg 3cfac58d78 Eliminate all console errors during test run
FREEBIE
8 years ago
Scott Nonnenberg 3e01d78c89 MessageListView remove unused reset-scroll event
FREEBIE
8 years ago
Scott Nonnenberg 73f2a4a0fb Simplify MessageListView.resetScrollPosition: no translation math
FREEBIE
8 years ago
Scott Nonnenberg bfdb8254a4 Scroll on new message only if we were already at bottom
FREEBIE
8 years ago
Scott Nonnenberg fed26c36ca Add new Last Seen Indicator with unread count, scroll to it
This is to ensure that when there are a lot of unread messages, the user
is given the chance to see all of them by being scrolled to the oldest
new message.

When a new message comes in, the indicator will be incremented.

When the user sends a message or switches away from the conversation,
the last seen indicator will be removed.

FREEBIE
8 years ago
lilia 3f1d8ee2b8 Fix display name for ios voice messages
iOS populates a filename for voice messages which was overruling our check for
the voice message flag when choosing the display name.

// FREEBIE
8 years ago
lilia 89a7875747 Remove unused function
This was supposed to solve the problem of losing group state after a reinstall
by inspecting member registration ids and pre-emptively sending group updates to
those who appear newly re-registered, but it has been unused since 6123c419.

Nowadays there's a protocol for requesting lost group state from other members.

// FREEBIE
8 years ago
lilia 80bfe18f02 Mark groups left on synced "You left the group"
When leaving a group on mobile, we sync the group quit message to desktop, but
we weren't marking the conversation left.

// FREEBIE
8 years ago
lilia 4842ef6153 Sync end session messages
// FREEBIE
8 years ago
lilia cfe0c77243 Conversation view blocks sending to left groups
Instead of attempting to send, which will throw an 'Unknown group' exception,
show a toast.

// FREEBIE
8 years ago
lilia 3ea5c0435b Update attachment style
Add names and sizes for all attachments except images, and (as with
arbitrary attachments), clicking on the text will open a save dialog.
In the absence of a filename, choose something that makes sense.

Display different icons for different media types, including distinct icons
for voice notes and audio files.

In iOS theme, audio, video, voice, and files are all encapsulated in bubbles.

Closes #804
Closes #842
Closes #836

// FREEBIE
8 years ago
lilia 6c53605dfd Flag voice note attachment protos as such
// FREEBIE
8 years ago
lilia 8bd7280673 Early read receipts should start expiration timers
Check for early read receipts for an incoming messages *after*
processing the expireTimer on that message. Then we can set
expirationStartTime appropriately if an early receipt is found.

Closes #950

// FREEBIE
8 years ago
Scott Nonnenberg 0496518af4 Bulletproof getCountOfAllMatches against non-global regex input
FREEBIE
8 years ago
Scott Nonnenberg 423a0fef67 Jumbomoji support matching Android support
FREEBIE
8 years ago
lilia aed5735620 Improve keychange notice reliability/perf
Bind a single listener to keychange events from the storage interface,
which then looks up relevant conversations and adds notices to them,
with tests.

Previously we would need to instantiate a conversation model in order to
start listening to its key change events. In practice this usually
happens at startup but we shouldn't rely on it, and it incurs higher
overhead since it creates a different listener for each conversation.

// FREEBIE
8 years ago
lilia 787c393e1b Log key change advisory creation
// FREEBIE
8 years ago
lilia 8aa2f771a7 Remove self-listener in conversation model
Since there is the only source/listener on this event, it can be called
directly.

// FREEBIE
8 years ago
Scott Nonnenberg ee00ad0e15 File attachments: show file size, bold filename, make icon bigger
FREEBIE
8 years ago
Scott Nonnenberg 2a04fa02df Introduce new filesize dependency
FREEBIE
8 years ago
lilia a5a9118c5c Fix empty bubble on accepting a new key
// FREEBIE
8 years ago
r-clancy 499ca5537a Increase max GIF size to match Signal-Android.
Signal-Android had the max GIF size changed to 25MB in
WhisperSystems/Android@ad0f283

This change brings parity to the two projects and fixed #1116.
8 years ago
lilia 7a8f2f0fec Allow sending arbitrary files 8 years ago
lilia 40af226a4a Move Whisper.events out of views and tests 8 years ago
lilia bab9580c3a Don't fallback to file view for images
Also lengthen the timeout a bit.

// FREEBIE
8 years ago
lilia 267f1f5d93 Use ISO format in log message 8 years ago
lilia 6b531ad342 Fix attachment size
This is already a number.

// FREEBIE
8 years ago
lilia c98ec91cab Fix tests again 8 years ago
lilia a2f0d6c739 Fix tests 8 years ago
lilia c9b4ae6e80 Save 'video/quicktime' files as .mov
Sometimes .mov files arrive with content type video/quicktime, but must
be saved to .mov in order for osx to recognize them as videos and open
the appropriate default program, display thumbnails, etc...

// FREEBIE
8 years ago
lilia a27ea20f3e Improve unsupported file type handling
Make arbitrary files look nicer and display the filename.

If an audio or video element fails to load for any reason, timeout after
a few seconds and render it as an arbitrary file. Also short circuit to
this treatment for common audio and video file types that we know are
going to fail, e.g., proprietary formats from apple.

// FREEBIE
8 years ago
lilia 27a1c9f18a Populate attachment file size
// FREEBIE
8 years ago
lilia fc514aa96f Add support for attachment file names
Send, receive, and save attachment filenames. Use them as suggested
names when saving files.

// FREEBIE
8 years ago
lilia a256f17e19 Cleanup attachment attributes
Convert attachment ids from longs to strings, and byte buffers to
arrays.

// FREEBIE
8 years ago
lilia b68f438cee Use appendChild instead of append
`append` is only supported in Chrome > 54

Fixes #1127

// FREEBIE
8 years ago
lilia dcfc4701c2 Tweak socket event logging 8 years ago
lilia 44a4ff3b52 Refactor install view
Let install view manage the connection to the provisioning socket as
well as cleaning up the window on completion, simplifying options.js.
Call `remove` so that the view stops listening when the window closes.
Move view script and template to background page.
Adds ability to hide nav if this isn't our first run.

// FREEBIE
8 years ago
lilia df65585e71 Network status listens to some global events
Listen for reconnectTimer to display reconnection info. Listen for
unauthorized to update network status immediately after a failed login,
rather than waiting for the normal 5s interval to time out.

// FREEBIE
8 years ago
lilia d3492960a6 Display info in network status when unlinked
When we can't connect due to being unlinked, network status indicator
will show an appropriate informational message and a button to open the
installer window to relink.

// FREEBIE
8 years ago
lilia 587e5265c5 Only re-render network status when it changes
// FREEBIE
8 years ago
lilia 3f05c8ff87 Rename window.events to Whisper events
// FREEBIE
8 years ago
lilia fcff07df98 Remove some global refs to window.events
// FREEBIE
8 years ago
lilia 510a5cb7fe Namespace global listeners to Whisper 8 years ago
lilia 3c2b7c8cbd Log missing signed prekey ids
// FREEBIE
8 years ago
lilia 26d97e621b Update libsignal-protocol 8 years ago
lilia cce1fe5c4b Simplify openConversation
Now that the InboxView is initialized in the background page context, we
can manipulate it more directly, without going through a global function
on the foreground window.

// FREEBIE
8 years ago
lilia 06e53871b2 Fix blank window after unlink
Don't wait for background init before rendering inbox.

If the client detects that it has become unlinked, it will not call
`init()`, never fire the deferredInit, and never render the inbox,
but we want to allow users access to their local messages even if they
have (perhaps temporarily) unlinked the desktop client.

Also, prefer not to extend Backbone.Model until/unless we really need
it.

// FREEBIE
8 years ago
Sam Vevang ed4991974b set up a new view for displaying the network status
// FREEBIE
8 years ago
Sam Vevang e4a21d1a53 move main application view over to messageReceiver namespace
The goal here is to allow synchronous property lookup between objects
and mvc/backbone semantics.

// FREEBIE
8 years ago
alecglassford ef4b4da2a3 Make search clear button ("x") persist w/o hover
This makes the "x" in the search bar always visible when there is
text in the search box, even if the mouse is not hovering, hopefully
making for a clearer UI around search and resolving issue #741

The implementation adds the "x.svg" as a background image to the search
box when it is classed with .active, in addition to the
-webkit-search-cancel-button, which is still there for the actual
functionality but only appears on mouse hover (one tiny snag is that
coloring appears slightly different on hover, at least on my screen -
don't know if this is a problem).

I accounted for both ltr and rtl text-direction by using
getComputedStyle(...).direction to detect from the input's dir="auto"
- if there's a more elegant way to do this, please suggest. An ideal
solution would use the :dir pseudo-class but it's not implemented
in Chrome yet - https://developer.mozilla.org/en-US/docs/Web/CSS/:dir

For now, I added the direction-checking to inbox_view.js. I see that
input.search is also used in new_group_update_view.js and
recipient_input_view.js but neither of these views seem to be in use (?)
and they don't set the .active class anyway, so I ignored them.

Update: Amended version a few hours later - fixed and manually tested
color and spacing for iOS and Android Dark themes. Also made some new
SASS variables to make things DRYer and fixed my tab size.
8 years ago
lilia a72c2968f2 Handle unknown request types
// FREEBIE
8 years ago
lilia d1114edcd4 Update libsignal-protocol-javascript 1.1.10
// FREEBIE
8 years ago
lilia 611bbaef35 Don't hardcode the attachment server url
There may come a day when we may need to change this url from the server
side. On that day, clients should continue to operate normally. The
service should be able to change attachment server locations without
requiring a client update.

// FREEBIE
8 years ago
lilia 43de0cc2ec Add attachment digests
// FREEBIE
8 years ago
lilia f1a1a819ba Stop parsing attachment ids from attachment urls
See 2111294

Attachment ids are now available in string form from the server
response to `putAttachment`.

// FREEBIE
8 years ago
lilia 4c945acb76 Remove unused object store reference
// FREEBIE
8 years ago
lilia 58d2f71e09 Add migration to clean up old expiring messages
Expiring messages received before 0.31.0 may not have an expires_at time
populated. Loading these messages once will update their expires_at if
it wasn't already set. To avoid loading too many messages into memory,
add them individually, and remove them from the collection as soon as
they are added, allowing them to be garbage collected immediately.

// FREEBIE
8 years ago
lilia 25ee61d3cb Fix timers after suspend/resume/pause
We use timers to decide when to query and delete expired messages or
when to perform signed key rotations.

Internally, timers are counters that get updated when the CPU ticks, so
if the CPU sleeps, the timer will stop counting, and start again after
it wakes up, ignoring the intervening passage of wall clock time.

To fix this, without having to query the database or other potentially
high overhead operations too often, use an interval to frequently check
the wall clock time. If time jumps forward, trigger a global event so
other listeners can update their possibly-inaccurate timers.

https://stackoverflow.com/questions/6346849/what-happens-to-settimeout-when-the-computer-goes-to-sleep
https://stackoverflow.com/questions/4079115/can-any-desktop-browsers-detect-when-the-computer-resumes-from-sleep

// FREEBIE
8 years ago
lilia 886557a2aa Drop chrome.runtime.onMessage events
We can use Backbone.Events instead.

// FREEBIE
8 years ago
lilia bba25b22e2 Log session deletions 8 years ago
lilia 527e7878a8 Fix unresolved promise in removeSession
Previously if there was no session to remove, the promise returned from
removeSession would never resolve, potentially blocking sending for that
recipient until restart.

// FREEBIE
8 years ago
lilia e4b9c51f88 Rework expiring messages management
// FREEBIE
8 years ago
lilia 08e8c00329 Restore setting lastMessage in handleDataMessage 8 years ago
lilia 0e31644c28 Remove spurious update to conversation on delivery receipts
Previously this would trigger the conversation to refresh it's last
message.

// FREEBIE
8 years ago
lilia b7fac17ec8 Avoid querying groups on delivery receipts if possible 8 years ago
lilia ace59147ab Reduce unnecessary updates on conversations at startup 8 years ago
lilia 280f7a74b1 Fix key change errors while retrying key change errors 8 years ago
lilia e1662f8537 Drop unneeded binds
There are no references to `this` in these functions.

// FREEBIE
8 years ago
lilia 7cbaac5590 Provisioning socket events don't block AccountManager tasks
// FREEBIE
8 years ago
lilia 38a830c561 Fixup account manager task queue
Such that it still pumps tasks if one of them throws/rejects.

// FREEBIE
8 years ago
lilia 51131df23b Update libsignal-protocol-javascript 1.1.9
// FREEBIE
8 years ago
lilia 6509646bdb Set expireTimer to null to unset
// FREEBIE
8 years ago
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
8 years ago
lilia da9b6c5245 Add logging for install and update events
// FREEBIE
8 years ago
lilia 54b856139a Fix fetchExpiring 8 years ago
lilia e648a4b095 Revert "Remove unregistered group members"
This reverts commit a768b94471.

d2ddfc7 was enough to fix #989. Removing unregistered members from the
group (as opposed to silently ignorning them) creates greater potential
for getting out of sync with the member lists on other devices.

// FREEBIE
8 years ago
lilia dfe9ee9679 Remove dead code 8 years ago
lilia 536dd7b951 Add signed key rotation scheduler
Rotate signed prekey every 48hrs, waiting for online access if
necessary. After a rotation attempt is made, schedule the next run for
48hrs in the future.

We use a timeout to "wake up" and handle the rotation. This timeout gets
set on startup and whenever the next rotation time is changed. For
paranoia's sake, always clear the current timeout before setting the
next one.

Since new registrations necessarily upload new signed keys, we reset the
scheduled time to T+48hrs on `registration_done` events.

// FREEBIE
8 years ago