Commit Graph

841 Commits

Author SHA1 Message Date
Daniel Gasienica
cd985aa700 Document type signature of FileInputView::readFile 2018-02-15 15:16:58 -05:00
Daniel Gasienica
d70d70e52c Move attachment processing closer to sending
This helps ensure processing happens uniformly, regardless of which code paths
are taken to send an attachment.
2018-02-15 15:16:58 -05:00
Daniel Gasienica
532ac3e273 Process attachment before it’s sent
Picked this place since it already had various async steps, similar to
`onMessageReceived` for the incoming `Attachment.process`.

Could we try have this live closer to where we store it in IndexedDB, e.g.
`Conversation::sendMessage`?
2018-02-15 15:16:58 -05:00
Daniel Gasienica
a4582ae2fb Refactor getFile and getFiles
Lint them using ESLint.
2018-02-15 15:16:58 -05:00
Daniel Gasienica
fdc3ef289d Highlight that dataURLToBlob is synchronous 2018-02-15 15:16:58 -05:00
Daniel Gasienica
8b6494ae6c Document potentially unexpected autoScale behavior 2018-02-15 15:14:59 -05:00
Daniel Gasienica
141155a153 Move blueimp-canvas-to-blob from Bower to npm 2018-02-15 15:14:59 -05:00
Daniel Gasienica
7ccb833e5d 🎨 Clarify data flow 2018-02-15 15:14:59 -05:00
Daniel Gasienica
e7da41591f Use blobUrl for consistency 2018-02-15 15:14:59 -05:00
Daniel Gasienica
523a80eefe Remove just-in-time image auto-orient for lightbox
We can bring this back if our users would like auto-orient for old attachments.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
0739feae9c Remove just-in-time auto-orient of message attachments
We can bring this back if our users would like auto-orient for old attachments. But better
yet, we might implement this as database migration.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
9638fbc987 Use contentType from model 2018-02-15 15:14:59 -05:00
Daniel Gasienica
59974db5a5 Improve readability 2018-02-15 15:14:59 -05:00
Daniel Gasienica
4822f49f22 Auto-orient images in lightbox view 2018-02-15 15:14:59 -05:00
Daniel Gasienica
7317110809 Document magic number for escape key 2018-02-15 15:14:59 -05:00
Daniel Gasienica
c790d07389 Make second View argument an options object 2018-02-15 15:14:59 -05:00
Daniel Gasienica
c285bf5e33 Replace loadImage with autoOrientImage 2018-02-15 15:14:59 -05:00
Daniel Gasienica
c77063afc6 Auto-orient preview images
See: #998
2018-02-15 15:14:59 -05:00
Daniel Gasienica
06dba5eb8f TODO: Use native Canvas::toBlob
One challenge is that `Canvas::toBlob` is async whereas `dataURLtoBlob` is sync.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
b15c304a31 Make null check strict
Appeases JSHint. ESLint has a nice `smart` option for `eqeqeq` rule:
https://eslint.org/docs/rules/eqeqeq#smart
2018-02-15 15:14:59 -05:00
Daniel Gasienica
ea70b92d9b Use Canvas::toDataURL to preserve ImageView logic
This way, all the other code paths remain untouched in case we want to remove
the auto-orient code once Chrome supports the `image-orientation` CSS property.

See:
- #998
- https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation
2018-02-15 15:14:59 -05:00
Daniel Gasienica
62fd744f9f Use CSS to constrain auto-oriented images 2018-02-15 15:14:59 -05:00
Daniel Gasienica
f4d3392687 Replace ImageView el with auto-oriented canvas
See: #998
2018-02-15 15:14:59 -05:00
Daniel Gasienica
1602d7f610 Pass Blob to View (for ImageView)
This allows us to do JPEG auto-orientation based on EXIF metadata.
2018-02-15 15:14:59 -05:00
Daniel Gasienica
e6a414f2b2 🔪 Remove newline 2018-02-15 15:14:59 -05:00
Scott Nonnenberg
7b49180bc0 Big update to new signal branding (#2018) 2018-01-30 14:22:51 -08:00
Scott Nonnenberg
72b7e4ec34 Process expireTimer and block status along with contact/group sync (#1980)
* Mark group as left = false if it is active in contact sync

* Handle expireTimer + blocked state along with contact/group sync
2018-01-29 18:14:39 -08:00
Scott Nonnenberg
fb2ebddaa3 Remove expired message if it expired during database fetch (#1983)
* Log SyncMessage destination, even if it's a group

* Remove disappearing message even if deleted during fetch

This change fixes a potential race condition with disappearing message
removal from the UI. If the UI is in the middle of making a database
request for messages to display, then we need to wait for that to
complete before removing the newly-deleted expired message.
2018-01-23 12:27:34 -08:00
Scott Nonnenberg
c70fb3a254 Video/audio: rely on the browser to detect content type (#1977) 2018-01-17 15:28:12 -08:00
Scott Nonnenberg
743e897541 Left pane: small sorting fix, logging for error cases (#1969) 2018-01-12 16:22:00 -08:00
Scott Nonnenberg
e999473f19 Preserve disabled state in the middle of sending message (#1937)
* Preserve disabled state in send-message field on click

Also: get consistent in treatment of 'disabled' property.

* Add some comments explaining how audio recording dismissal works
2018-01-04 16:51:00 -08:00
Scott Nonnenberg
7781f8fa5b Treat tiffs like unrecognized files; Chrome doesn't render them (#1901) 2017-12-14 17:32:58 -08:00
Scott Nonnenberg
2430ee00d4 Emoji: Eliminate unused images, make sure panel clicks add emoji (#1849)
* Emoji: Ensure that all clicks work by using emoji data directly

* Eliminate a number of unused emoji images from final build

* Re-add the generic sheets directory, which we partially filter
2017-12-04 10:19:35 -08:00
Scott Nonnenberg
0e328f3911 Merge branch 'master' into development
This catches the development branch up with v1.0.39 in master.
2017-11-21 18:25:59 -08:00
Scott Nonnenberg
87d8ec723a Remove conversation from left pane on 'delete messages' (#1807) 2017-11-21 16:37:58 -08:00
Scott Nonnenberg
83428e5b81 Remove last seen indicator if we get a sync'd outgoing message (#1805)
This mirrors the way Android does things.
2017-11-21 14:41:05 -08:00
Scott Nonnenberg
34dd375260 Be resilient to thrown non-errors in import process (#1737) 2017-11-08 17:32:33 -08:00
Lilia
fb931b4733 Emoji picker (#1608)
* Add emoji button and popup panel

This integrates a simple third party emoji panel with a few css overrides to
correct some relative paths and colors.

The trickiest thing about this is ensuring we don't break the layout, which is
acheived through precise control over the panel's height, and prodigious calls
to updateMessageFieldSize.

// FREEBIE

* Don't close emoji panel on click, do close on send

To better facilitate multiple emoji entry.

// FREEBIE

* Make panel emojis bigger and higher resolution

// FREEBIE

* Move paperclip button to the right of the microphone

This makes our bottom-bar button arrangement more comfortable and consistent
with Android.

// FREEBIE

* Move emoji picker padding to inner container

* Insert emojis at cursor position

Don't just append to the end like a n00b! Also handle selected text correctly.
https://stackoverflow.com/questions/11076975

// FREEBIE

* A few visual tweaks to reduce visual complexity of emoji panel

- No gray buffer on the right side of the emoji panel
- No gray buffer between message compose text box and emoji window
- The scroll bar for the emojis is the same as our normal scrollbars
2017-10-30 13:54:55 -07:00
Scott Nonnenberg
dabc56d0cf Load profiles for a conversation without blocking convo load (#1570) 2017-10-18 11:59:12 -07:00
Scott Nonnenberg
75cece3358 Improve OS menu (#1563)
* Remove reload options, new file/help menus, tools/log at bottom

* Further menus refactor: install handlers at template creation

* WIP: Further tune menus, add custom about window

* New About window, new help menu items, menu labels now i18n

* Default device name on registration is now computer hostname

The OS of the device makes sense for those of us testing across a lot of
different OSes. And maybe for a user with just one desktop device. But
most users with multiple desktop devices are using the same OS for both.

* About window: Only show window when content is ready

* Fix typo in app/menu.js
2017-10-13 16:49:16 -07:00
Scott Nonnenberg
151d1797db Fix intermittent conversation sort order problem (#1558)
We were inserting based on what was already in the DOM, instead of
using the index from our conversation collection.

FREEBIE
2017-10-13 11:47:13 -07:00
Axel
3dc3667b45 Add setting to hide menu bar (#1551)
* Add setting to hide menu bar

Add a setting in the themes section to hide the menu bar.
The menu bar is not needed in everyday use and might not fit in with
signals dark theme. The hidden menu bar can still be shown by pressing
alt.
autoHideMenuBar is added to windowConfig and saved and restored on
startup to prevent flickering.

* Trigger events only when related setting changes

Set the event to trigger on instanciation of the view.
Notification settings no longer reapply the theme or menu bar settings.

* Save window state when closing the window

When not moving or resizing the window, no BrowserWindow config would be
created and saved.
2017-10-13 11:39:18 -07:00
Scott Nonnenberg
f95c65acac Add 100MB file size limit for arbitrary file types (#1555)
Previously we only had limits for audio, video, and image files.

FREEBIE
2017-10-11 14:41:51 -07:00
Scott Nonnenberg
b44f23cc98 Show proper icon when attachment is not an image (#1548)
FREEBIE
2017-10-10 08:49:29 -07:00
Lilia
52cc8355a6 Feature: Blue check marks for read messages if opted in (#1489)
* Refactor delivery receipt event handler

* Rename the delivery receipt event

For less ambiguity with read receipts.

* Rename synced read event

For less ambiguity with read receipts from other Signal users.

* Add support for incoming receipt messages

Handle ReceiptMessages, which may include encrypted delivery receipts or read
receipts from recipients of our sent messages.

// FREEBIE

* Rename ReadReceipts to ReadSyncs

* Render read messages with blue double checks

* Send read receipts to senders of incoming messages

// FREEBIE

* Move ReadSyncs to their own file

// FREEBIE

* Fixup old comments on read receipts (now read syncs)

And some variable renaming for extra clarity.

// FREEBIE

* Add global setting for read receipts

Don't send read receipt messages unless the setting is enabled.
Don't process read receipts if the setting is disabled.

// FREEBIE

* Sync read receipt setting from mobile

Toggling this setting on your mobile device should sync it to Desktop. When
linking, use the setting in the provisioning message.

// FREEBIE

* Send receipt messages silently

Avoid generating phantom messages on ios

// FREEBIE

* Save recipients on the outgoing message models

For accurate tracking and display of sent/delivered/read state, even if group
membership changes later.

// FREEBIE

* Fix conversation type in profile key update handling

// FREEBIE

* Set recipients on synced sent messages

* Render saved recipients in message detail if available

For older messages, where we did not save the intended set of recipients at the
time of sending, fall back to the current group membership.

// FREEBIE

* Record who has been successfully sent to

// FREEBIE

* Record who a message has been delivered to

* Invert the not-clickable class

* Fix readReceipt setting sync when linking

* Render per recipient sent/delivered/read status

In the message detail view for outgoing messages, render each recipient's
individual sent/delivered/read status with respect to this message, as long as
there are no errors associated with the recipient (ie, safety number changes,
user not registered, etc...) since the error icon is displayed in that case.

*Messages sent before this change may not have per-recipient status lists
and will simply show no status icon.

// FREEBIE

* Add configuration sync request

Send these requests in a one-off fashion when:
  1. We have just setup from a chrome app import
  2. We have just upgraded to read-receipt support

// FREEBIE

* Expose sendRequestConfigurationSyncMessage

// FREEBIE

* Fix handling of incoming delivery receipts - union with array

FREEBIE
2017-10-04 15:28:43 -07:00
Scott Nonnenberg
ffbcb4ecb5 Load debug log dialog immediately, then populate log data (#1540)
An immediate response to the user request to see the log, and then we
show the real data as soon as we've loaded it from disk.

Changes:
  - the IPC exchange to get the log data is now async
  - the API to fetch the log on the client side now returns a Promise
  - in the main process, the only disk access done synchronoously is
    reading the contents of the log directory. The JSON parsing of the
    resultant log data is now split up into three chunks.
  - We only send three keys from each log item to the renderer process:
    msg, time, level. Previously we sent the entire log entry with extra
    keys: hostname, pid, name.

FREEBIE
2017-10-04 14:40:35 -07:00
Scott Nonnenberg
3b4fd2d0e0 Eliminate $name$ in two places (#1520)
* Eliminate $name$ when changedRightAfterVerify string is shown

FREEBIE

* Eliminate $name$ when identityKeyErrorOnSend string is shown

FREEBIE
2017-09-29 09:09:40 -07:00
Scott Nonnenberg
314b29e426 Redact group ids in logging
FREEBIE
2017-09-25 16:41:57 -07:00
Scott Nonnenberg
6b11f67dc6 Move logging to disk via bunyan
- Logging is available in main process as well as renderer process, and
  entries all go to one set of rotating files. Log entries in the
  renderer process go to DevTools as well as the console. Entries from
  the main process only show up in the console.
- We save three days of logs, one day per file in %userData%/logs
- The 'debug' object store is deleted in a new database migration
- Timestamps and level included in the new log we generate for publish
  as well as the devtools
- The bunyan API is exposed via windows.log (providing the ability to
  log at different levels, and save objects instead of just text), so we
  can move our code to it over time.

FREEBIE
2017-09-25 15:00:34 -07:00
Lilia
42f2142e36 Fix RangeError on non-file drag/drop events (#1498)
ConversationView responds to drag/drop events by forwarding them to its file
input. The file input stops propagation and handles the event only if the data
transfer is type file. This means that any other data type (text, img, etc...)
causes an recursive loop of event propagation, eventually resulting in logging a
"RangeError: Maximum call stack size exceeded".

Fix by only forwarding files to the file input.

// FREEBIE
2017-09-22 09:44:09 -07:00