Commit graph

355 commits

Author SHA1 Message Date
Matt Corallo
c112c59ce6 Fix group send (fixes #129) 2015-01-19 10:04:11 -10:00
lilia
94e14f2c85 Add license headers
Closes #75
2015-01-18 14:21:22 -10:00
lilia
5d044bd00e Fire an event on phone number validation
Fix a bug introduced by recent phone number input work that prevented
the call and sms buttons from being clickable.
2015-01-17 22:51:32 -10:00
lilia
f6376c0fa2 Rename event
'open' seems a better name for an event that triggers the open function.
2015-01-17 22:33:55 -10:00
lilia
f73596c240 Add a view for attachment previews 2015-01-16 13:39:01 -10:00
Emily Chao
bb2b53035e Restyled message attachments
Added a size limit, added functionality to delete the attachments before sending in a more user-friendly way
2015-01-16 13:06:49 -10:00
lilia
9baafddb14 Add license to file input view 2015-01-16 13:06:38 -10:00
lilia
d470b0eb53 Less jquery, more templating in conversation view
`if (foo) then jquery-dom-insert...` is a poor pattern to follow.
Instead, let mustache do the work.
2015-01-15 22:34:52 -10:00
Emily Chao
e74cba8a92 Restyled country dropdown
Added jquery plugin that allows for flags and country codes to be
displayed in a user-friendly way, on top of the existing phone view
2015-01-15 15:24:36 -10:00
Emily Chao
5d3020b9ed Refactor phone number input view
Moves validation logic to its own view to be shared on index and options
pages.
2015-01-15 11:51:32 -10:00
lilia
44007ca58f Add rudimentary ui for sending a group update 2015-01-15 09:23:13 -10:00
Matt Corallo
334550b779 Regenerate components/libts 2015-01-14 11:39:36 -10:00
Matt Corallo
5785f4033c Compile curve25519/webcrypto into libtextsecure.js 2015-01-14 09:35:57 -10:00
Matt Corallo
07899557dc Give libtextsecure its own components (with way fewer deps) 2015-01-14 09:35:57 -10:00
Matt Corallo
8ad1a38b5b Move js files around for libtextsecure split 2015-01-14 09:35:57 -10:00
Matt Corallo
13d403b334 Switch to isNumberSane in group storage 2015-01-14 09:35:57 -10:00
Matt Corallo
17782660e2 Add isNumberSane to textsecure.utils for basic validation 2015-01-14 09:35:57 -10:00
Matt Corallo
6b933455e3 Merge pull request #108 from TheBlueMatt/refreshgroup
Replace all the refreshGroups stuff
2015-01-14 09:35:20 -10:00
Matt Corallo
eac506557f Replace refreshGroups with singular refreshGroup on send 2015-01-14 09:34:36 -10:00
Matt Corallo
0b19e5b9c3 Replace numer->group with group->number->registrationId tracking 2015-01-14 09:34:36 -10:00
Matt Corallo
67bb400b87 Revert "Don't refreshGroups in tryMessageAgain", making a better one
This reverts commit f9e68be45b.

Conflicts:
	js/sendmessage.js
2015-01-14 09:34:36 -10:00
lilia
d119bdff01 restore default avatars 2015-01-14 01:37:41 -10:00
Matt Corallo
6124084807 Bring padding calculation in-line with android 2015-01-12 21:26:12 -10:00
lilia
d8efc4d216 Handle incoming group avatars on group creation 2015-01-11 12:33:59 -10:00
lilia
3d6c251fd1 Group avatars 2015-01-11 01:27:22 -10:00
lilia
d52db8fe6f Render group updates
Not pretty, but it works. Also allows for later localization.
Copy/behavior is borrowed from the Android client.

Closes #104
Fixes #65
2015-01-10 08:08:20 -10:00
lilia
4e6faf4e27 Always listen for (re-)registration events
If we clear local storage and re-register in a foreground page, the
background page needs to re-init its websocket with the new account
credentials.
2015-01-07 19:09:07 -10:00
Matt Corallo
7ebf0f5085 Remove last \t in protocol.js 2015-01-06 14:47:03 -08:00
Matt Corallo
406be10f53 s/\t/ /g in sendmessage.js 2015-01-06 14:39:54 -08:00
lilia
fca67d7b0e Simplify pushMessageContent handler slightly
New private conversations have their type set in onMessageReceived. New
group conversations should be handled the same way as normal group
updates. It was pointed out we should never have to handle a group
message without a preceding group update, as those would be rejected by
textsecure.processDecrypted. An exception would be if you delete the
group from indexedDB but not localStorage, but that's not a mode we
should be supporting.

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

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

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

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

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

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

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