Commit Graph

430 Commits (f693c007782ef8f28180aac0d58b4de18e4b964b)

Author SHA1 Message Date
lilia 510a5cb7fe Namespace global listeners to Whisper 8 years ago
Sam Vevang ed4991974b set up a new view for displaying the network status
// 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 ace59147ab Reduce unnecessary updates on conversations at startup 8 years ago
lilia 6509646bdb Set expireTimer to null to unset
// 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 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
8 years ago
haffenloher a768b94471 Remove unregistered group members
Locally remove unregistered users from group membership lists.

Fixes #989
Related to Whispersystems/Signal-Android#6175
Closes #1052

// FREEBIE
8 years ago
haffenloher 04f0142b23 Ignore missing members in incoming group updates
Previously, updateNumbers would throw an Error, so the whole group
update was discarded.

Signal-Android handles this the same way in
GroupMessageProcessor.handleGroupUpdate().

Closes #1056
8 years ago
Thomas Guillet 400313f749 Prevent expiration timer update on group update
It occurs when a message with a different expiration time is received.

The issue report highlights the scenario of a member leaving a group
(group update [quit] sent with expiration time = 0).

Fix https://github.com/WhisperSystems/Signal-Android/issues/5996
Fix https://github.com/WhisperSystems/Signal-iOS/issues/1566
8 years ago
lilia 9ef61d43f4 Update conversation lastMessage from database
Don't set lastMessage, let it update itself as needed, such as when
first rendering a conversation list item, and when its messages are
sent, received, or destroyed.
8 years ago
lilia 6253269d19 Tweak key change advisory insertion
Let received_at be the current time for keychanges. This avoids them
being inserted in the wrong place in the thread.

Use the newmessage event to trigger frontend listeners to add them to
the conversation view if it is open.
8 years ago
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.
8 years ago
lilia d2c1e6df27 Fix wrong variable name
Fix potentially setting expiration timeouts more than once.
8 years ago
lilia d7f241ddee Use correct type on timer updates 8 years ago
lilia 05ed7c3822 Merge timer update functions 8 years ago
lilia 0854b19371 Revert "Don't load group contacts unnecessarily"
This reverts commit 6699571910.

Not quite ready for primetime.
9 years ago
lilia 6699571910 Don't load group contacts unnecessarily
There are some cases when we want to initialize a group object without
loading its contacts, such as while processing delivery receipts. We
really only need to load the contacts for a group/convo when we are
rendering it, so let the front end handle those cases (which most of
them do already).
9 years ago
lilia 03c5d12edd Fix necrobumping convos on key change
When inserting key change advisories, use the current conversation
timestamp to avoid pushing lots of old groups to the top of the
conversation list.
9 years ago
lilia f8a3ae158c Remove log message 9 years ago
lilia d3a2f5c838 Ignore expireTimer on session reset messages 9 years ago
lilia 4ee2652367 Fix wrong contact in some timer updates
Mistakenly showed 'You' for timer updates inferred from incoming
messages.
9 years ago
lilia 7fe708d195 Insert keychange advisories
On click, these open a verification panel for the relevant contact,
within this conversation.

// FREEBIE
9 years ago
lilia 009098f8dd Insert inferred timer updates before the corresponding message 9 years ago
lilia a12569e356 Fix destination on synced timer updates 9 years ago
lilia 56aee5e8ef Update conversation snippets automatically
Fixes stale snippets after the message has expired
9 years ago
lilia 8d16bfb65e Populate conversation snippet for timer updates 9 years ago
lilia e488c19889 Do not trigger notifications for timer updates 9 years ago
lilia 7a26cf79ee Insert timer update messages when inferring timer changes 9 years ago
lilia ad2174e279 Sync expirationStartTimestamp on outgoing messages
Linked devices need to know when to start the clock.
9 years ago
lilia 6074a29046 Send timer update messages when changing the timer 9 years ago
lilia 824b7417e9 Apply expireTimer to outgoing messages 9 years ago
lilia 2b2c6ab040 Frontend for timer updates and timer indicator 9 years ago
lilia 4cd2c03687 Add clock svg style 9 years ago
lilia 7331d967d2 Add support for expiration timer updates messages 9 years ago
lilia 5f92ccd524 Render animated hourglass when messages are expiring 9 years ago
lilia 1383dc141f Ensure that expired messages are removed from the frontend 9 years ago
lilia 02ea4f2475 Use read receipt envelope to infer startExpirationTime
Avoids display of phantom messages that are only received and marked
read locally long after they have expired on another linked device.
9 years ago
lilia 96fd017890 Support for incoming expiring messages
When initialized, or when expiration-related attributes change, expiring
messages will set timers to self-destruct. On self-destruct they trigger
'expired' events so that frontend listeners can clean up any collections
and views referencing them.

At startup, load all messages pending expiration so they can start their
timers even if they haven't been loaded in the frontend yet.

Todo: Remove expired conversation snippets from the left pane.
9 years ago
lilia edd6f58539 Update display when contact colors change
// FREEBIE
9 years ago
lilia f610233ef6 Add support for syncing blocked numbers
// FREEBIE
9 years ago
lilia 53f20640af Add support for syncing colors
// FREEBIE
9 years ago
lilia 7b9894d688 Refactor css to support theming
Move away from inline style attributes for setting contact colors.
Apply colors by name via css classes instead. Also lays groundwork
for syncing contact colors.

// FREEBIE
9 years ago
lilia e07616e2ef Only create notifications for unread messages
In some cases, we have already received a read receipt for an incoming
message by the time we go to create a notification about it. In this
case, we should skip the notification.

// FREEBIE
9 years ago
lilia 8939c61c7c Log on notification removal
// FREEBIE
9 years ago
lilia 7caecc564d Process all incoming conflicts before outgoing ones
Fixes a session management problem where, after resolving a conflict
with some contact, that contact would get bad mac as a result of us
sending them a new prekey message before processing a pending conflicted
prekey message received from them earlier.

Fixes #806

// FREEBIE
9 years ago
lilia 148bd32671 Update libsignal-protocol v0.10.0
* Changes policy for old session deletion
* Renames putIdentityKey to saveIdentity
* Remove device messages

// FREEBIE
9 years ago
2-4601 b9ecdbf402 i18n 'Error handling incoming message'
// FREEBIE
9 years ago
2-4601 60fe1e2cea i18n 'Received message with unknown identity key'
// FREEBIE
9 years ago
2-4601 52992a8f12 i18n 'Secure session ended'
// FREEBIE
9 years ago
lilia 1d60dc38fb Rename axolotl storage
// FREEBIE
9 years ago
lilia dd7d72a77d i18n 'Media message'
Fixes #736

// FREEBIE
9 years ago
lilia 172d843368 Always update lastMessage on incoming messages
Fixes #742

// FREEBIE
9 years ago
lilia 0cd7f84a05 Refactor read state tracking
Adds support for handling early arriving read receipts.

// FREEBIE
9 years ago
lilia d1e9534542 Refactor delivery receipt tracking
Move code for matching receipts to messages (and vice versa) to its own
file.

// FREEBIE
9 years ago
lilia 18012688ea Log unread message timestamps
// FREEBIE
9 years ago
lilia 0f4f00ff4e Fix read sync on duplicate messages
In the case of a double send (same message encrypted and sent twice due
to key conflict bug), we would mark the first instance read twice rather
than marking both instances read. Fix by searching for matching messages
that have not yet been marked read.

// FREEBIE
9 years ago
lilia 07a0463b65 Fix conversation list self-resorting
When deleting all messages in a conversation, the entry in the left pane
should be inserted into the alphabetical portion of the list. To keep it
in this collection, do not nullify active_at.

To ensure the list view is keeping itself correctly sorted, make sure
that resorting behavior is triggered any time a relevant attribute is
changed.

This fixes deleted conversations jumping to the top of the list, and
conversation order scrambling when getting a group or contact sync
message from our master device.

Fixes #734

// FREEBIE
9 years ago
lilia 3901bcb8df Style resend button as an inline link
For messages that failed to send due to network errors, this change
allows retrying them directly from the main conversation view rather
than only from the message detail view.

// FREEBIE
9 years ago
lilia 234f937bc7 Conversation subscreens share a header
// FREEBIE
9 years ago
lilia c8aa2246dc Let groups have blue headers
// FREEBIE
9 years ago
lilia 18a5ce8e54 Restyle conversation panel
// FREEBIE
9 years ago
lilia 8b3596b956 Delete last timestamp on a convo when deleting messages
// FREEBIE
9 years ago
lilia 6f3f33657a Don't mark read on sync messages
There's no longer a need for this since we have read-state syncing.

// FREEBIE
9 years ago
lilia 762cb68721 Serialize sending and adding messages to a convo
Previously, if a message was sent in between the receive time of an
incoming message and the time it is actually added to the conversation's
message collection (which only occurs later after several async
callbacks), the incoming message would be inserted not-at-the-end of the
collection since it is ordered by receive time. This tricked the front
end into assuming the message was an older message instead of a new one.

Fixes #490

// FREEBIE
9 years ago
lilia f9a3c7817e DRY up early receipt processing
// FREEBIE
9 years ago
lilia 67900753d1 Log sending read receipts
// FREEBIE
9 years ago
lilia 0763cf14a3 Remove messages from notifications when read
Remove individual messages from Notifications when marked read.
Previously this was only done from the conversation model when marking
the entire conversation as read.

Fixes #717

// FREEBIE
9 years ago
lilia 2b7cbef8b1 Rename a function
Avoid confusing this operation with actual receipts, which are something
else.

// FREEBIE
9 years ago
lilia b77d5df4f2 Fix markRead when messages have not been loaded yet
Query the database and not just the in-memory messages.

// FREEBIE
9 years ago
lilia 01053335ac Don't send empty read status reports
// FREEBIE
9 years ago
lilia f88b33a135 Fix unread message lookup in markRead
// FREEBIE
9 years ago
lilia c4a88dd651 Fix getUnread query
Booleans are not valid keys in indexeddb.
https://www.w3.org/TR/IndexedDB/#dfn-valid-key

// FREEBIE
9 years ago
lilia 2e30c4388f Set destination on end session messages for syncing
// FREEBIE
9 years ago
lilia e91f646920 Fix initial post-sync timestamps
Fixes #669

// FREEBIE
9 years ago
lilia 71467822f6 Clear key conflict before replaying it
Don't save the change until we successfully process the message, but
make it first so that the user sees the error disappear when the new key
is accepted.

// FREEBIE
9 years ago
lilia 1f897f32b7 Track and sync unread messages
// FREEBIE
9 years ago
lilia ecf2885a6c Do post-send tasks when resolving conflicts
Fixes #684

// FREEBIE
9 years ago
lilia 731052ad0a Clear old key conflict errors after failed replay
If the replay failed due to a bad mac or other decryption error for some
other reason we still want to clear the conflict. If it failed because
it's still in conflict then the newly returned error will reflect that
and be saved.

// FREEBIE
9 years ago
lilia 7e8ce5eb54 Omit left groups from search
Unless they contain messages.

// FREEBIE
9 years ago
lilia 010297f4c5 Track groups I've left
// FREEBIE
9 years ago
lilia 173e037fa6 Fix minor style errors
And keep it that way, by making jscs config more opinionated.

// FREEBIE
9 years ago
lilia b602533084 Serialize calls to sendSyncMessage
Fixes #679

// FREEBIE
9 years ago
lilia 7e82d1295c Handle attachment upload errors
Adds a new kind of replayable error that handles retry of pre-encryption
failures, e.g., attachment upload.

Fixes #485

// FREEBIE
9 years ago
lilia 137b992f87 Fix "Delete Messages" not deleting all messages
Since the introduction of infinite scroll, the delete messages function
has only deleted the currently loaded set of messages in a conversation.
To fix this, we should fetch all the messages and then delete them.

Fixes #645

// FREEBIE
9 years ago
lilia b2bed9c51c Fix display of empty group updates
Group updates in which nothing change should still display 'Updated the
group'. Previously they would display as empty message bubbles. Fixed by
ensuring that the 'group_update' attribute is set on the model, even if
it is an empty object.

// FREEBIE
9 years ago
Karel Bilek 557d33bf88 Fixing upper bounds on contact search (fixes #545) 9 years ago
lilia 1d6e391dd6 Prefer single quotes
// FREEBIE
9 years ago
lilia bc576e18d5 Fix no delivery receipts on close session messages
// FREEBIE
9 years ago
lilia dabe51fd68 Mark message sent iff at least 1 recipient got it
Previously, we would always mark a message sent even if all our network
requests failed.

Fix #484

// FREEBIE
9 years ago
lilia 63135a2337 Fix race between sync messages and receipts
Previously, when processing a backlog of sync messages and their
delivery receipts, we would fail to mark some messages as delivered even
though we got a receipt. This was due to an async race condition between
saving a sync message and fetching it after the receipt arrives.

Fix by re-ordering idb requests such that we save the message first and
fetch it after.

Fixes #479

// FREEBIE
9 years ago
lilia 720032bb8e Remove id from search tokens
Instead, just strip the leading + from search queries that look like
numbers.

// FREEBIE
9 years ago
lilia a258f1a66b Refactor number parsing and validation
Refactor libphonenumber.validateNumber into libphonenumber.parseNumber,
which encapsulates the try-catch pattern used in number parsing and
returns an object of info about the input number rather tha throwing
since we expect to get some invalid number inputs the user is typing.

In the conversation model,
  * Separate phone number validation from search token updating.
  * Perform token update before save if the number was valid.
  * Stop storing unneeded number variants as conversation properties.

// FREEBIE
9 years ago
lilia 65c13adf5e Fix searching for numbers with parens or dashes
Strip some punctuation from search queries

// FREEBIE
9 years ago
lilia af64784d64 Let search match on full e164 format numbers
// FREEBIE
9 years ago
lilia 0b7742ecd7 Create contact by number with no country code or +
Search box finds or creates a conversation given a phone number in
local (to the user's region) or international format.

Previously you had to enter e164 format to set up the conversation
correctly.

If the number is not valid, do not open the conversation.

TODO: user feedback on invalid numbers.

// FREEBIE
9 years ago
lilia 0b95606eff Display nicely formatted phone numbers
In conversation headers and as titles for contacts with no name. Updated
tests accordingly.

// FREEBIE
9 years ago
lilia 0620f08a7c Save single errors returned from send functions
// FREEBIE
10 years ago
lilia 2f469835d9 Handle group quit sync messages
Previously, we would incorrectly reject group updates originating from a
linked device instructing us to remove ourselves from the group.

// FREEBIE
10 years ago
Georg Semmler 1a6cedac56 Fix #402
Remove messages which are read from the notification
10 years ago
lilia 7bf94c33d5 Show all contacts when inbox is empty 10 years ago
lilia 07702c4ee5 Let the application layer send sync messages
Previously, libtextsecure would send a sync message automatically
when appropriate. This fails if any recipient has a key conflict
or if our network connection fails mid-send.

Instead, when appropriate, return a the DataMessage encoded as an array
buffer for later syncing. This lets the application choose when to send
it, which we now do after any successful send to a recipient, rather
than after all recipients are successfully sent to.

Eventually we should move the DataMessage protobuf construction and
group sending logic to the application layer entirely, in which case
we wouldn't need libtextsecure to construct the sync message either.

Fixes #408
10 years ago
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
10 years ago
lilia 4615e730ca Save ReferenceErrors on messages
// FREEBIE
10 years ago
lilia 2861fa26a7 Implement infinite scrolling message lists
Only load the most recent messages when initially rendering a
conversation. Scrolling to the top of a message list loads older
messages.

This required some slight refactoring of how we insert message elements
into the dom. If the message is added to the end of the collection,
append it at the end. Otherwise, assume it is an older message and
prepend it.

When adding elements to the top, reset the scrollPosition to its
previous distance from scrollHeight. This keeps the current set of
elements fixed in the viewport.

// FREEBIE
10 years ago
lilia b59b702eb3 Clear the lastMessage when deleting a conversation
Leave no trace. Fixes #397.

// FREEBIE
10 years ago
lilia a569e34b33 Refactor new message notification and frontend updates
Create a cleaner seperation between generating notifications
and updating frontend conversation views. The former is now
handled by `conversation.notify` while the latter is achieved
by triggering an event on the conversation model, which will
only be acted on if there are any views listening for it.

Additionally, instead of re-fetching the entire message history,
which is overkill, just add or update the new/modified message.
This will help speed up the newmessage event handler and also
help avoid unnecessary re-rendering when resolving key conflicts.

// FREEBIE
10 years ago
lilia 4136e3633c Fix incoming key conflict behaviors
Follow up to ddd2e67eb5
but for incoming messages.

* Conflict state sometimes failed to be removed even though the
  conflict was resolved.
* Messages failed to re-render after a conflict. We want to
  re-render only the error state on outgoing messages, to avoid
  flickering attachments. On incoming messages, we need to call
  render to populate the message text, avatar, etc...

// FREEBIE
10 years ago
lilia 9c8933c3d0 Resolve conflicts one at a time
Previously, with a mix of text and media messages in conflict,
asynchronous callbacks aligned so as to fail to remove some of
the conflict objects on messages.

Fix by serializing conflict processing, but making sure to move
on through the message list even if some conflict resolutions fail.

Fixes #370

// FREEBIE
10 years ago
lilia 4c4b875348 Fix displaying contact names as 'Unknown Group'
// FREEBIE
10 years ago
lilia c64fe8410e Convo list shows 'Media message' when appropriate
// FREEBIE
10 years ago
lilia 503509fc8f Fix blank lastMessage for non-text messages
For non text messages (ex: media messages and group updates), the
lastMessage field was being populated with empty string, resulting in an
empty message preview in the conversation list. Instead, display 'Media
message' or 'Updated the group', etc...

// FREEBIE
10 years ago
lilia c77391b3f2 Sinewave animation for pending requests
Tryin it on for size.

// FREEBIE
10 years ago
lilia e68b84ad9a Fix saving TypeErrors
// FREEBIE
10 years ago
lilia ee393bfa03 Ensure that tokens get updated on initial save
// FREEBIE
10 years ago
lilia 82ce76265d Remove stray log statement
// FREEBIE
10 years ago
lilia f70c22f898 Add search field to inbox
Using the search field produces a filtered view of all contacts and
groups containing the input. To make this fast and scalable, add an
index on a 'tokens' array containing words from the conversation name
and different forms of phone number.

Closes #365

// FREEBIE
10 years ago
lilia a32f3ff1f6 More work on replayable errors
Expose a button that does that retries outgoing messages if possible.

// FREEBIE
10 years ago
lilia 7ec4700431 Handle saving errors when none exist already
// FREEBIE
10 years ago
lilia ae25d62ef2 Fix up post-conflict resolution error processing
// FREEBIE
10 years ago
lilia fbb65d1988 Add replayable network errors
Support for manual message retry.

// FREEBIE
10 years ago
lilia 19423bf909 Abstract message error handling
// FREEBIE
10 years ago
lilia 569d0655fa Fix test failure
// FREEBIE
10 years ago
lilia 876e11c19b Fix sync messages not getting displayed on arrival
// FREEBIE
10 years ago
lilia 7d6adc4879 Save outgoing error codes when messages fail
// FREEBIE
10 years ago
lilia a802322d44 Display a default message for incoming message errors
An exception to the previous commit, for incoming messages we should not
show a mysterious empty bubble. Instead there is some generic
non-technical error message.

// FREEBIE
10 years ago
lilia 929c16090b Move error messages to message detail view
Change how message errors are rendered. Errors associated with a number
will be shown under that number in the detail view rather than piling up
in the message bubble.

// FREEBIE
10 years ago
lilia c1b9f3235f Save all errors
But clean up objects created by the Error constructor, as they contain
non-serializable properties, like functions.

// FREEBIE
10 years ago
lilia 04c5f83485 Un-nest libtextsecure errors
Fix inconsistency in error format, where we sometimes get an unexpected
Error object and sometimes get a wrapper object containing an Error.

Also start saving network errors.

// FREEBIE
10 years ago
lilia 8453424ebd Fix stuck pending messages state
Refactor outgoing message error handling to use the same success and
error handlers. This creates a somewhat strange pattern, where we call
send and pass in the promise that resolves when sending is complete, but
there's enough variety in the libtextsecure syntax for different message
sending routines that it belongs at the conversation level and only the
post-processing stuff is really shared by all messages.

// FREEBIE
10 years ago
lilia 9ff95c7e61 DRY up group update sending
// FREEBIE
10 years ago
lilia f6b35ffbfc Log error stack traces
// FREEBIE
10 years ago
lilia 213dbdefd2 Reorder functions
// FREEBIE
10 years ago
lilia d1191c509c Log outgoing errors individually
// FREEBIE
10 years ago
lilia ada3d999e0 Log outgoing errors
// FREEBIE
10 years ago
lilia d8803ee31f Mark leave group messages as sent
// FREEBIE
10 years ago
lilia 6364cda7cb Create requires an object
// FREEBIE
10 years ago
lilia b617240338 Stop calling updateInbox all the time
Now that the inbox collection keeps itself in sync, we don't have the
data duplication that was forcing us to reload constantly.

// FREEBIE
10 years ago
lilia 2bc65c2ab4 Let messages fetch references to senders
The conversation's contactCollection only contains references to the
current membership, and will not provide contact info for people who
have left the group, causing their messages to render without numbers or
avatars.

// FREEBIE
10 years ago
lilia 4b0c70fb44 Resolve multiple conflicts independently
When resolving multiple conflicts in a conversation, failure to resolve
one should not block any others.

// FREEBIE
10 years ago
lilia 80764bf494 Remove unused function
// FREEBIE
10 years ago
lilia 1a30d003f5 Fetch group contacts before fetching new messages
Messages must wait for sender info to arrive before rendering.

// FREEBIE
10 years ago
lilia e8edbe53bc Improve notification behavior
Only allow one notification at a time. Use a basic notification for
normal messages, and image notification for image messages, and a list
notification when there are multiple unread messages.

// FREEBIE
10 years ago
lilia 59313b5177 Let message models manage blob urls for attachments
// FREEBIE
10 years ago
lilia 0ebdf08ceb Render identicons in notifications
Render an svg, then canvas, then data url.

Fixes #325

// FREEBIE
10 years ago
lilia 3bd9108f6e Use isPrivate helper
// FREEBIE
10 years ago
lilia d6d1a7da55 Don't notify on sync messages
// FREEBIE
10 years ago
lilia 0509bb0f5d Remove global updateInbox, used scoped version
// FREEBIE
10 years ago
lilia 2ab7315c80 Use generic collection for conversation contacts
Let the conversation controller instatiate the models in order to avoid
having duplicate models in memory.

// FREEBIE
10 years ago
lilia 6d4bf4e5d1 Whitespace
// FREEBIE
10 years ago
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
10 years ago
lilia 89f5f216ed Fix new conversation with no lastMessage 10 years ago
lilia 21aaf0fab5 Clean up notification and unread indicator behavior 10 years ago
lilia baa55c9018 Refactor for less model duplication 10 years ago
lilia 98a14e9a6a Fix bug in message model
conversation.changedAttributes returns false when there are no changes.
10 years ago
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.
10 years ago
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
10 years ago
lilia d808d255eb Fix bug with 0th contact color
Contact color css class wasn't being rendered because 0 is falsey.

// FREEBIE
10 years ago
lilia 47b58b8994 Use the correct number of contact colors
Bugfix from 2f12275
10 years ago
lilia 2f12275cb9 Update contact colors
Make default contact color assignments consistent with
WhisperSystems/Textsecure@99d3a76b
10 years ago
lilia fd5b0aeb85 Set lastmessage text on convo's with no timestamp 10 years ago
lilia 17a3025af2 Mark end session messages sent 10 years ago
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
10 years ago
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
10 years ago
lilia b44c12807c Mark messages sent after resolving outgoing key conflicts 10 years ago
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
10 years ago
lilia fa4022a4e3 Invert pending/sent model 10 years ago
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
10 years ago
lilia 3cbe4f1f46 remove unused argument 10 years ago
lilia 29360fea5c Fixes #275 default group image 10 years ago
lilia feb5e5b068 Display gray # instead of colored + for no-name contacts
For consistency with android.
10 years ago
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.
10 years ago
lilia 6a5f923cac Don't set attributes redundantly
By the time we get here, these should have already been set in
background.js.

// FREEBIE
10 years ago
lilia 18433419c9 PushMessageContent is now DataMessage 10 years ago
lilia 290283f810 Conversations do not require timestamps
Synced contacts will not include timestamps
10 years ago
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.
10 years ago
lilia 9795b26bc1 Supress change event on avatarUrl initialization 10 years ago
lilia 363c436b33 Handle single-error rejections when sending messages
We can not assume that we will get back an error array.

Closes #258 // FREEBIE
10 years ago
lilia 6e1a41e9cf Update inbox when group avatars change 10 years ago
lilia a66c879426 Update inbox after destroying a conversation
Fixes #247

// FREEBIE
10 years ago
lilia 3e39271220 Render messages light blue until finished sending // Fixes #219 10 years ago
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.
10 years ago
lilia b83ce7a015 Delay conversation creation til post-decrypt 10 years ago
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
10 years ago
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
10 years ago
lilia 1b83932a29 Update open conversations on sync messages 10 years ago
lilia 1ed0ef5bc3 Process group updates before sync delivery receipts
Because we need to know the group members to find early-arrival
receipts.
10 years ago
lilia 654373d743 Fix null conversationId on group sync messages 10 years ago
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.
10 years ago
lilia c4fa2cb935 Fix sync message timestamps 10 years ago
lilia 20ebc3f890 Move identity key storage functions to axolotl store 10 years ago
lilia 71715c95bc Async remove identity 10 years ago
lilia 90c742d57c More error logging 10 years ago
lilia c51773ab0e More helpful error logging 10 years ago
lilia a2d88b4fad Don't trigger notifications for sync messages 10 years ago
lilia ce36c36bd0 Include outgoing control messages in message history
So you know it worked.
10 years ago
lilia f067bb9954 Remove dead code 10 years ago
lilia fdb0935d6a Fix resolveConflicts for groups 10 years ago