Commit graph

1608 commits

Author SHA1 Message Date
lilia
6b531ad342 Fix attachment size
This is already a number.

// FREEBIE
2017-04-18 18:09:21 -07:00
lilia
c98ec91cab Fix tests again 2017-04-18 16:51:56 -07:00
lilia
a2f0d6c739 Fix tests 2017-04-18 16:39:00 -07:00
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
2017-04-18 16:27:50 -07:00
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
2017-04-18 16:27:50 -07:00
lilia
27a1c9f18a Populate attachment file size
// FREEBIE
2017-04-18 12:08:37 -07:00
lilia
fc514aa96f Add support for attachment file names
Send, receive, and save attachment filenames. Use them as suggested
names when saving files.

// FREEBIE
2017-04-18 11:48:56 -07:00
lilia
a256f17e19 Cleanup attachment attributes
Convert attachment ids from longs to strings, and byte buffers to
arrays.

// FREEBIE
2017-04-18 11:48:53 -07:00
lilia
b68f438cee Use appendChild instead of append
`append` is only supported in Chrome > 54

Fixes #1127

// FREEBIE
2017-04-15 23:46:02 -07:00
lilia
dcfc4701c2 Tweak socket event logging 2017-04-13 13:15:42 -07:00
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
2017-04-13 13:15:42 -07:00
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
2017-04-12 20:43:16 -07:00
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
2017-04-12 20:43:16 -07:00
lilia
587e5265c5 Only re-render network status when it changes
// FREEBIE
2017-04-12 20:43:16 -07:00
lilia
3f05c8ff87 Rename window.events to Whisper events
// FREEBIE
2017-04-12 20:43:16 -07:00
lilia
fcff07df98 Remove some global refs to window.events
// FREEBIE
2017-04-12 20:43:16 -07:00
lilia
510a5cb7fe Namespace global listeners to Whisper 2017-04-12 20:43:16 -07:00
lilia
3c2b7c8cbd Log missing signed prekey ids
// FREEBIE
2017-04-12 13:02:31 -07:00
lilia
26d97e621b Update libsignal-protocol 2017-04-12 13:02:31 -07:00
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
2017-04-10 12:45:58 -07:00
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
2017-04-10 12:43:14 -07:00
Sam Vevang
ed4991974b set up a new view for displaying the network status
// FREEBIE
2017-04-08 00:10:56 -07:00
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
2017-04-08 00:10:56 -07:00
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.
2017-04-08 00:06:48 -07:00
lilia
a72c2968f2 Handle unknown request types
// FREEBIE
2017-04-07 19:35:25 -07:00
lilia
d1114edcd4 Update libsignal-protocol-javascript 1.1.10
// FREEBIE
2017-03-28 11:37:50 -07:00
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
2017-03-10 15:24:19 -08:00
lilia
43de0cc2ec Add attachment digests
// FREEBIE
2017-03-10 14:40:45 -08:00
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
2017-03-10 10:44:26 -08:00
lilia
4c945acb76 Remove unused object store reference
// FREEBIE
2017-03-04 17:57:32 -08:00
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
2017-03-01 18:05:36 -08:00
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
2017-03-01 14:36:40 -08:00
lilia
886557a2aa Drop chrome.runtime.onMessage events
We can use Backbone.Events instead.

// FREEBIE
2017-02-28 11:49:56 -08:00
lilia
bba25b22e2 Log session deletions 2017-02-28 11:29:26 -08:00
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
2017-02-28 11:29:26 -08:00
lilia
e4b9c51f88 Rework expiring messages management
// FREEBIE
2017-02-22 16:18:01 -08:00
lilia
08e8c00329 Restore setting lastMessage in handleDataMessage 2017-02-22 16:15:27 -08:00
lilia
0e31644c28 Remove spurious update to conversation on delivery receipts
Previously this would trigger the conversation to refresh it's last
message.

// FREEBIE
2017-02-22 15:41:12 -08:00
lilia
b7fac17ec8 Avoid querying groups on delivery receipts if possible 2017-02-22 15:41:12 -08:00
lilia
ace59147ab Reduce unnecessary updates on conversations at startup 2017-02-22 01:22:44 -08:00
lilia
280f7a74b1 Fix key change errors while retrying key change errors 2017-02-22 01:17:21 -08:00
lilia
e1662f8537 Drop unneeded binds
There are no references to `this` in these functions.

// FREEBIE
2017-02-22 01:17:21 -08:00
lilia
7cbaac5590 Provisioning socket events don't block AccountManager tasks
// FREEBIE
2017-02-22 01:17:21 -08:00
lilia
38a830c561 Fixup account manager task queue
Such that it still pumps tasks if one of them throws/rejects.

// FREEBIE
2017-02-22 01:17:20 -08:00
lilia
51131df23b Update libsignal-protocol-javascript 1.1.9
// FREEBIE
2017-02-22 01:17:20 -08:00
lilia
6509646bdb Set expireTimer to null to unset
// FREEBIE
2017-02-22 01:17:20 -08:00
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
2017-02-20 19:03:08 -08:00
lilia
da9b6c5245 Add logging for install and update events
// FREEBIE
2017-02-17 12:50:26 -08:00
lilia
54b856139a Fix fetchExpiring 2017-02-17 12:10:20 -08:00
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
2017-02-16 18:06:20 -08:00