Commit graph

1430 commits

Author SHA1 Message Date
lilia
f6b35ffbfc Log error stack traces
// FREEBIE
2015-09-23 16:30:30 -07:00
lilia
213dbdefd2 Reorder functions
// FREEBIE
2015-09-23 16:30:30 -07:00
lilia
62c90e3925 Don't save/log websocket error
It's a generic error Event and doesn't actually contain anything useful.

// FREEBIE
2015-09-23 16:30:30 -07:00
lilia
289b82d1dc Expose messageReceiver.close
// FREEBIE
2015-09-23 16:30:29 -07:00
lilia
1d370857fc Remove unused callback arguments
Unused since d0fd3e94 afaict.

// FREEBIE
2015-09-23 16:07:21 -07:00
lilia
2204ef863d Fix event name
We successfully retry after a websocket connection closes, but this typo
prevented us from retrying if the websocket simply never opened.

// FREEBIE
2015-09-23 16:07:20 -07:00
lilia
d1191c509c Log outgoing errors individually
// FREEBIE
2015-09-21 11:48:57 -07:00
lilia
ada3d999e0 Log outgoing errors
// FREEBIE
2015-09-21 11:02:33 -07:00
lilia
ce49d14d85 Fix leave group bug
This one's been around since forever, but only manifests when someone
leaves the group and comes back. In that case we fail to reinit their
numberRegistrationId object, which causes a npe when we try to send
send them group messages.

Affected parties must ask their fickle friends to leave/join again.

// FREEBIE
2015-09-21 11:00:12 -07:00
lilia
4a482243d0 Simplify event arguments
// FREEBIE
2015-09-21 10:32:35 -07:00
lilia
c8a76ab38e Fix websocket event handler name
// FREEBIE
2015-09-21 10:32:35 -07:00
lilia
21667d9181 Log when we start waiting for an online event
// FREEBIE
2015-09-21 10:32:35 -07:00
lilia
823f570955 Add more websocket debug logging
// FREEBIE
2015-09-21 10:32:34 -07:00
lilia
f70e844cef Include url in http response logging
Otherwise it's impossible to tell which is which, especially when
sending group messages.

// FREEBIE
2015-09-21 10:32:34 -07:00
lilia
d8803ee31f Mark leave group messages as sent
// FREEBIE
2015-09-21 10:32:33 -07:00
lilia
b1d3829651 Update minimal window dimensions
Some day we'll probably lower these minimums but first we'd need a more
responsive design.

Fixes #310

// FREEBIE
2015-09-18 13:13:31 -07:00
lilia
960754ef04 Restyle compose button
Move it to a tool bar at the top of the conversation list. This is also
where a search bar will live someday.

Fixes #357

// FREEBIE
2015-09-18 13:08:52 -07:00
lilia
2243c09fea MessageReceiver is an event target
Rather than asking for a global target, the message receiver implements
the EventTarget interface itself. It does not expose the dispatchEvent
method, however. This ensures that events can only be triggered from
within the internal MessageReceiver class, which means we no longer need
to namespace them.

// FREEBIE
2015-09-18 09:30:12 -07:00
lilia
a925027cd2 Refactor MessageReceiver for storage/server independence
Let the libtextsecure consumer pass in their own server url, username,
password, and signaling key, as with libtextsecure-java.

Also brings reconnect logic up into the MessageReceiver class, which
is the only place it should apply.
2015-09-17 16:52:32 -07:00
lilia
e59a5792d5 Don't hardcode the attachment host 2015-09-17 16:02:22 -07:00
lilia
184e37383c Don't auto-populate the relay field
According to server api docs, relay is optional when it is the same as
our own server.

// FREEBIE
2015-09-17 16:02:22 -07:00
lilia
7d9cf0c167 Pass the signaling key into decryptWebSocketMessage
De-couple this file from dependency on storage.
2015-09-17 16:02:22 -07:00
lilia
c167fc964d Revert "Remove global updateInbox method"
This reverts commit 1c70293bba.

This broke tests by blocking the database deletion during test
setup.
2015-09-17 15:42:13 -07:00
lilia
87ce3241c8 Remove script-tag for nonexistant test
// FREEBIE
2015-09-17 15:25:13 -07:00
lilia
310f40fcad Contact sync should update existing contacts
// FREEBIE
2015-09-17 14:26:25 -07:00
lilia
7f4ef6e9e7 Remove double-check of unread count
This same condition is already enforced in the markRead method.

// FREEBIE
2015-09-17 13:46:58 -07:00
lilia
1c70293bba Remove global updateInbox method
This operation now needs to be done exactly once, at startup, so we
don't need to expose a global method for it.

// FREEBIE
2015-09-17 13:44:44 -07:00
lilia
6364cda7cb Create requires an object
// FREEBIE
2015-09-17 11:42:59 -07:00
lilia
78d7296f84 Fix tests
// FREEBIE
2015-09-17 11:40:42 -07:00
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
2015-09-17 10:57:17 -07:00
lilia
537f0ceef0 Log all http requests at start and end
// FREEBIE
2015-09-17 10:57:17 -07:00
lilia
0017f196ef Move ConversationController to its own file
Encapsulate the global conversation cache collection against accidental
access, avoiding the data-clobbering bug fixed in previous commit.

Also move some one-off program initialization code from panel controller
to background.js

// FREEBIE
2015-09-16 23:43:14 -07:00
lilia
8f28c3af68 Fix disappearing contact info
This errant reference to the global cache of conversations was causing
some contacts to get clobbered.

// FREEBIE
2015-09-16 22:47:42 -07:00
lilia
93a5d01127 Delete old code
We don't have any more 'default' css classes. Default avatar data is
simply provided by a model for rendering in a view.

// FREEBIE
2015-09-16 22:19:04 -07:00
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
2015-09-16 22:15:47 -07:00
lilia
fd29ac8d2c Promote groups to top of inbox when we update them
// FREEBIE
2015-09-16 18:01:39 -07:00
lilia
73983118dc Render emoji in conversation title // Fixes #359
// FREEBIE
2015-09-16 16:40:11 -07:00
lilia
6f94888659 Use online event listener to reconnect more smrtly
No need to retry if we know we're offline.

// FREEBIE
2015-09-16 15:16:39 -07:00
lilia
37998e261d Log more errors
// FREEBIE
2015-09-16 14:41:20 -07:00
lilia
36ec4300cf Fix broken group avatar preview
Fixes #355

// FREEBIE
2015-09-16 12:29:16 -07:00
lilia
b60d3d0b97 Make debug log handle multiple arguments
Ex: console.log('delivery receipt', phone_number, timestamp)

// FREEBIE
2015-09-16 11:29:01 -07:00
lilia
90e9216e19 Add UI for submitting debug logs
Fixes #343

// FREEBIE
2015-09-16 11:28:37 -07:00
lilia
9809894fd2 Automatically mark the open conversation read
If a conversation view is visible, it will automatically mark the
conversation read.

// FREEBIE
2015-09-15 20:50:00 -07:00
lilia
15a366dbf0 Opening a conversation should focus the window
Previously, this function might open the conversation but not show the
window, if it exists but wasn't on top.

// FREEBIE
2015-09-15 20:41:48 -07:00
lilia
a57451d00b Show notifications if the window is minimized
// FREEBIE
2015-09-15 20:30:45 -07:00
lilia
f74a7b9621 Add code for submitting debug logs
We keep the last 1000 log messages in memory and dump them to an
anonymous public gist if console.post is called.

// FREEBIE
2015-09-15 18:48:50 -07:00
lilia
fa0e2584f4 Fix new threads not appearing at top of inbox
When messages from someone not in your inbox arrived, that thread would
appear at the bottom of the inbox instead of the top.

// FREEBIE
2015-09-15 16:45:52 -07:00
lilia
df99da15c6 Mark relevant convos active/unread on key conflict
// FREEBIE
2015-09-15 14:40:37 -07:00
lilia
15d84199c2 Include ourselves in member list for a new group
Otherwise, the next incoming group update will show "<your number>
joined the group".

// FREEBIE
2015-09-15 13:58:17 -07:00
lilia
8b27c99f2b Fix exception while creating a conversation
When confirming the creation of a one on one conversation with a new
contact, the first click would do nothing but the second click would
work. Now the first click works.

Fix by only reject new conversation creation if not saved.

// FREEBIE
2015-09-15 13:24:09 -07:00