Commit Graph

549 Commits (84237cae6f12b55cd317cf80fb87a37ca88dc75e)

Author SHA1 Message Date
lilia 0da04632f2 Scale large images even if they are small
Previously we would not scale large resolution images with small file
sizes, but in fact, both resolution and file size constraints should be
enforced.
10 years ago
lilia 567a48e82b Adjust widths of bubbles and chat window
With these changes, message bubbles in the default-sized chat popup are
just wide enough to display the full complement of html5 media player
controls.
10 years ago
lilia 8bc77fa02b Automatically compress and scale large images
Do nothing to other file types. Continue to block files that are too
large even after scaling and compression.
10 years ago
lilia 37d20b986b Add canvas.toBlob polyfill 10 years ago
lilia 68d68e9009 Add blueimp lib for html5's canvas-based image scaling 10 years ago
lilia 258a872ce3 Trigger update events after attachments load
Mostly so we can ensure we're scrolled to the bottom when the
conversation is loaded.
10 years ago
lilia f9ca13a86f DRY up audio and video views 10 years ago
lilia df06499a19 Use blob urls to display attachments
Converting attachment data to base64-encoded data uris takes O(n) and
there's no need! URL.createObjectURL returns a magic link that can be
set as the `src` attribute to `img`, `video`, and `audio` tags to load
blob data directly without copying.

https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
10 years ago
lilia 4cefd17ac6 Remove unused view 10 years ago
lilia 9d94bce92a After clearing messages, leave conversation open
Fixes #178
10 years ago
lilia 0778854cc4 Attachments should be in spans, not divs 10 years ago
lilia 1311f7c9ae Fix attachment previews for audio/video files 10 years ago
lilia 6fe262ceed Lazy init file input's FileReader 10 years ago
lilia db7dee9a8a Fixup file size warning
Add contentType-specific limits, switch to lazy-init iff we encounter an
oversized file, and restyle as a toast, factoring out a generic
ToastView along the way.
10 years ago
lilia ddc0ed1b9a Add audio and video players
Basic implementation using html5 audio/video tags and data URIs.
10 years ago
lilia aa659877be Fix broken file input view 10 years ago
lilia dcc1588219 Add key verification screen
Accessible from the menu on private conversations.
10 years ago
lilia c08c29bd4a Render group members in the message detail view
This requires that we fetch contact info when opening a conversation
so that's available for rendering contact names and avatars.
10 years ago
Matt Corallo 2277b41639 Remove non-existant device messages 10 years ago
Matt Corallo 5abf3073d5 Check END_SESSION messages in processDecrypted 10 years ago
Matt Corallo 29192edcb8 Ignore END_SESSION on messages with a sync context 10 years ago
Matt Corallo 9c3f8a1868 Dont send group-update right before we quit the group
Fixes #166
10 years ago
lilia fd30dc6f1a Add message detail view 10 years ago
lilia 368cd2f79a Refactor back button style
Make it easier to reuse these styles.
10 years ago
Matt Corallo f2853d00e6 Merge pull request #167 from WhisperSystems/sync
Sync outgoing individual and group messages
10 years ago
lilia f860cb4492 Return end session messages to the frontend
So we can save them in the message history, and because the caller
expects a promise.
10 years ago
lilia 55c46d1bb6 Close conversation menu when clicking outside it 10 years ago
lilia e853c21c98 Remove unused code
There is no .settings-btn or .go-back in this view.
10 years ago
lilia ec43a0b633 jshint all the things
Small style fixes here and there. Removed one unused file.
10 years ago
lilia 09704444e9 Fix missing delivery receipt checkmarks
The delivered class should be updated on each render to ensure it is
up to date.
10 years ago
lilia 06e8e0dca7 Remove an extension.trigger
No need to trigger an extension-wide event now that all our models live
in the background page. We can just update them more or less directly.
10 years ago
lilia 626b63ee7c Fix some jshints 10 years ago
lilia 3292177a96 Remove resize logic in favor of pure css 10 years ago
lilia 07e44ccf21 Revisit resize and scroll logic once more
Wait a little longer on initial scroll down. Previous timeout sometimes
triggered before all text is finished rendering.

Remove redundant resize calls.
10 years ago
lilia 1bdb42b67e Fix bug loading conversation upsidedown
Sometimes a conversation's messages would be reverse-ordered on first
load, correcting themselves after a refresh. This is an artifact of the
order we load messages from the database. To fix, load them in the
opposite order.

The alternative solution would be to reset the collection every time we
fetch new messages, but this would create an entirely new set of model
objects each time, which seems unnecessary.
10 years ago
lilia 296dae544d Open conversation on receiving a message w/ errors 10 years ago
lilia 955ef60292 Fix list_view-related error in background page
Background page conversations were trying to trigger events on the inbox
list view which had been destroyed, resulting in a background page
console error of "can't read innerHeight of null".

Avoid this by removing listeners when the inbox window is closed.
10 years ago
lilia 1c589f2fad Fix list_view.js and message_view.js whitespace 10 years ago
lilia 61581bae7f Fix inbox comparator 10 years ago
lilia 4716754209 Refactor content message class names 10 years ago
lilia 40351fcc54 Sync outgoing messages
When sending an constrct a copy of the PushMessageContent protobuf, add
a SyncMessageContext, and send it to ourselves. Do this for all kinds of
group messages, and individual text/media messages, but not closeSession
messages as the latter are device-specific.

Do not sync messages if we are the primary device, which should only be
supported in development. Normal web clients must be paired with a
android or ios master device, and even in dev, a primary/standalone web
client does not support linking additional devices.
10 years ago
lilia 94c94eb7c9 Refactor message view
The message view has three flavors so far, a normal text+attachments
message, a group update, and an end session message. This changeset
extracts the normal message rendering into its own subview, and adds
some convenience functions to the message model in order to simplify
some of that flavoring logic.
10 years ago
lilia 85bec04010 Render leave-group messages correctly 10 years ago
lilia 367421d40a Style end session messages
Also add a missing call to render()
10 years ago
lilia f00a8f1e81 Render end session messages correctly 10 years ago
lilia 488f25635d Wire up end session and leave group
Closes #136
Closes #137
10 years ago
lilia 85b4643e9b Fixes #161
The first message sent to a new contact was throwing 'Unknown Group'.
This was because we didn't wait for the initial save to sync the `type`
attribute to indexedDB. Instead, don't trigger the conversation to open
until it has finished saving.
10 years ago
Matt Corallo b45c09470f Merge pull request #155 from WhisperSystems/closeSession
Fix textsecure.closeSession
10 years ago
Matt Corallo 04b1ab23a4 Merge pull request #154 from WhisperSystems/fixolotl
Fix provisioning flow
10 years ago
lilia 0e8a5806a8 Fix textsecure.closeSession
sendIndividualProto requires a timestamp.
10 years ago
lilia 96af6b56ef Handle incoming sync messages
Assign them to the correct conversation and mark them outgoing with the
correct timestamp.

Closes #150
10 years ago
lilia 65c70a9117 Fix provisioning flow
Fix undefined axolotl.protobufs.ProvisionMessage, referenced in
libaxolotl/protocol.js
10 years ago
Matt Corallo 148410a826 Move jquery dep from libaxolotl to libaxolotl tests 10 years ago
Matt Corallo 44a094c324 Re-run concat 10 years ago
Matt Corallo f1f5914879 Re-run concat 10 years ago
Matt Corallo cb6cb4ff89 Re-add jquery as it is needed for our test runners 10 years ago
Matt Corallo 8398a52c20 Re-run concat 10 years ago
Matt Corallo bb32a51d66 s/textsecure.protocol/axolotl.protocol/ 10 years ago
Matt Corallo 403ae4376d Move attachment/websocket [en|de]cryption to libtextsecure 10 years ago
Matt Corallo 184b1ec89c Move protocol protobufs to libaxolotl/, handling DeviceControl 10 years ago
lilia 05a5b7e76c Fixes #152
Android client was crashing any time the base64-encoded public key
included a '+' due to lack of url encoding.
10 years ago
lilia a104ee9ca6 Remove unused variables 10 years ago
lilia 44f9ea5d49 Fix identity key error rendering 10 years ago
lilia 9fe99adf0c Get scrolling right on conversation load 10 years ago
lilia f5c7be7d35 Add some resizes 10 years ago
lilia 5a302271b3 Remove unneeded listeners 10 years ago
lilia 0463e385e8 Remove uneeded render
This is an artifact of a time when conversation elements would pop in
and out of the dom at a moment's notice, and thus needed to rebind their
event listeners regularly.
10 years ago
lilia 5e064db28f Render the message list view. 10 years ago
lilia 5ad5464dd1 Fetch messages in the background 10 years ago
lilia 52b3114970 Simplify list view resizing 10 years ago
lilia 3279dddcc3 Consolidate window logic in panel controller
Previously the conversation window would query the background page
for a model id and then fetch the conversation. Instead, we can fetch
the conversation before opening the window, which simplifies the front
end scripts and avoids creating multiple copies of the same model.
10 years ago
lilia 44b1e5c88e Move inbox collection to the background page
No more waiting, no more messy fetch logic. Background page
bootstraps the inbox and keeps it up to date.
10 years ago
lilia a5bc261365 Clear selected files after each sent message 10 years ago
lilia 2de682ef7b Don't create a group without a name 10 years ago
lilia d5c85dfbd8 Resize inbox listview after it finishes loading
Ensures that scrollbars are properly setup on load.
10 years ago
lilia 4422582ab7 Fixup opening existing private conversations 10 years ago
lilia 200981e022 Avoid adding empty-string numbers to recipients 10 years ago
lilia 3a099657e6 Untangle select vs open events 10 years ago
lilia b27826cba5 Conversations must have an id before saving 10 years ago
lilia a7a44e9b99 Swap in unminified typeahead code
For your debugging and auditing convenience.
10 years ago
lilia 9087918500 Don't add new convos to inbox until a message is sent 10 years ago
lilia af49ad9b90 Dry up new contact init and handling 10 years ago
lilia 63d232dedb Draw attention to invalid numbers 10 years ago
lilia 746e6530b9 WIP pill view for selected recipients 10 years ago
lilia c84ccfc735 Wrap model phonenumber validation in try/catch 10 years ago
lilia eae072e72d Remove unneeded var, add todo 10 years ago
lilia fc3a600e72 Validate conversation type 10 years ago
lilia 5e3ed1658b Show phone numbers in contact selector 10 years ago
lilia 9e245e67e0 Fix double-opening exsisting conversations from typeahead 10 years ago
lilia b2345a5ec8 Remove unused variable 10 years ago
lilia ce4ce164af Stop clobbering conversation attributes
Unless the background page fetches the latest details of a conversation
before updating it, it may clobber or nullify some attributes e.g., the
contact's name.
10 years ago
lilia aca3db97da New messages auto-update the inbox & conversation
When a new message arrives, if its conversation is not already opened,
the background page opens it. If it is alrady open the window is
focused. Finally, the 'message' event is triggered, resulting in
   1. the inbox refetches conversations
   2. all conversations fetch new messages

TODO: only send this event to the target window
10 years ago
lilia db5e7fd6b6 Fix list view scrolling
Resize handlers are ugly. But not as ugly as scroll handlers. :p
Normalized some whitespace along the way.
10 years ago
lilia 0f29cf2043 Put spaces between joined members in group updates 10 years ago
lilia d435ff003b Improve typeahead contact selector experience
Store and match on various phone number formats. Still not perfect, as
occasionally all the models are returned for a non-matching query.
10 years ago
lilia acc2c6f536 Sort contact selector by title 10 years ago
lilia 51dd287b60 Break up a long line 10 years ago
lilia a00632c728 Hook up group creation flow UI
Checkboxes add and remove members as well as exposing the group update
ui. The conversation window is opened after saving the group.
10 years ago
lilia b3e32a2642 Only load contacts (not groups) in the typeahead 10 years ago
lilia 2f93fb9fbc Remove unneeded comparator
This collection is just an in-memory indexer used for typeaheads. For
display, the matching models are added to a separate collection. Thus,
the order of the elements in the typeahead collection does not matter.
10 years ago