Commit graph

569 commits

Author SHA1 Message Date
Mikunj
a09e370e1d Added testing on pull request
Disable proxy in tests.
2020-02-28 14:51:09 +11:00
Vincent
548db7150d Start message selection reactification 2020-02-28 09:49:03 +11:00
Vincent
5d11ef1457 Header props 2020-02-27 10:01:18 +11:00
Vincent
a5905536fa Onload scroll to unread 2020-02-26 15:39:02 +11:00
Brian Jian Zhao
ccb470207a use storage instead of component state to store the zoom setting 2020-02-26 15:08:41 +11:00
Vincent
8a609efffe Scrolling stuff 2020-02-26 14:23:19 +11:00
Brian Jian Zhao
203d314254 fix the slider bug 2020-02-26 13:30:56 +11:00
Brian Jian Zhao
23da1831c2 removed unnecessary comments after review 2020-02-26 11:54:44 +11:00
Audric Ackermann
f5b3eb394c
enable notifications after 10seconds of start or reconnect 2020-02-25 16:08:56 +11:00
Vincent
752ee8a614 Message conditional rendering 2020-02-25 15:20:34 +11:00
Brian Jian Zhao
cb7289d3d8 working but buggy 2020-02-21 10:37:58 +11:00
Brian Jian Zhao
7a0f2c9ce3 add electron webFrame API to preloadJS 2020-02-20 17:15:39 +11:00
Brian Jian Zhao
b2322bae02 check to whether the zoomFactor is shown in preload.js 2020-02-20 14:46:54 +11:00
Brian
96e9a68abd add zoomfactor to main 2020-02-20 00:08:47 +11:00
Vincent
30ccb81d3d Disappearing messages in Channel Settings panel 2020-02-13 15:35:09 +11:00
Vincent
cf0b9e45fa Emoji spacing & message highlight formatting 2020-02-12 14:29:07 +11:00
Vincent
2101abb911 Modal blurs and stylistic simplifications 2020-02-12 13:53:18 +11:00
Vincent
b4c6c37b16 constants renaming 2020-02-05 15:19:18 +11:00
Vincent
4fd2126fbe Fileserver update 2020-02-05 10:08:55 +11:00
Vincent
250a3ad6c1 Closed groups overlay integration 2020-02-05 09:59:55 +11:00
Ryan Tharp
d0cc5a57f8
Merge pull request #759 from neuroscr/tls-fix
Move disable TLS rejection to only lokiRpc
2020-02-03 18:28:48 -08:00
Ryan Tharp
ed41e562c5
enable useSealedSender too per Maxim 2020-02-03 18:28:01 -08:00
Ryan Tharp
3964e9acf0
Merge branch 'clearnet' into tls-fix 2020-02-03 16:59:59 -08:00
Ryan Tharp
1d03b3a68e
Desktop: enable useSnodeProxy feature flag 2020-02-03 16:58:22 -08:00
Vince
5bbd136493
Merge pull request #758 from neuroscr/version-check
Version check, de-signal.org-ification
2020-02-03 17:11:17 +11:00
Vincent
c0a33a630f Join channel generalisation 2020-02-03 15:50:38 +11:00
Vincent
2d4bf2b3e2 Complete conditional message onboarding 2020-02-03 11:49:04 +11:00
Maxim Shishmarev
3f58dea035 Remove mixpanel 2020-01-31 10:14:30 +11:00
Ryan Tharp
615a41fa21
Merge branch 'clearnet' into tls-fix 2020-01-29 22:51:41 -08:00
Maxim Shishmarev
02320334f0 Remove P2P 2020-01-30 11:47:37 +11:00
Ryan Tharp
04e1d58a50 remove ugly TLS hack 2020-01-29 03:16:07 -08:00
Ryan Tharp
acf4529904 expose semver and LokiAppDotNetServerAPI because we can't get ourKey from storage early enough 2020-01-29 02:51:05 -08:00
Vince
310038ec31
Merge pull request #748 from loki-project/brand-redesign
Brand redesign
2020-01-29 13:10:16 +11:00
Audric Ackermann
d68aeb947e
Merge branch 'clearnet' into brand-redesign 2020-01-29 12:00:18 +11:00
Maxim Shishmarev
b405b150cc Sealed sender support 2020-01-29 11:08:13 +11:00
Ryan Tharp
11359fc037
Merge branch 'clearnet' into fileproxy 2020-01-27 22:46:44 -08:00
Vincent
4a7e2dece7 Password lock screen and delete data screen 2020-01-28 16:43:39 +11:00
Vincent
0a525629ee Prevent illegal username and passwords 2020-01-24 17:10:42 +11:00
Vincent
56b1bcac01 Partial copy updates 2020-01-22 17:17:15 +11:00
Vincent
4fe82d28d9 Version info 2020-01-22 15:57:58 +11:00
Vincent
010cf045cb optimisation of ternary & binary expr. 2020-01-20 14:36:46 +11:00
Vincent
e065cc404f Password set, change and remove complete 2020-01-20 14:10:28 +11:00
Vincent
35d59c75eb Password set, change and remove complete 2020-01-20 14:10:22 +11:00
Vincent
c26097554f settings optimisations 2020-01-16 12:08:31 +11:00
Vincent
d217c76647 mergable settingsview 2020-01-15 13:49:07 +11:00
Vincent
cc3e206504 stagepoint sessionsettings bak 2020-01-14 15:37:52 +11:00
Vincent
8de2ce9e23 Theme toggle and settings abstraction 2020-01-14 13:28:31 +11:00
Maxim Shishmarev
a195c98061 Add a feature flag for snode proxy 2019-12-19 11:46:44 +11:00
Audric Ackermann
8d11553fe5 add a *ignore* method to Promise to make tslint happy 2019-12-16 09:38:34 +11:00
sachaaaaa
db0068b429 Sending and handling of special UNPAIRING_REQUEST message 2019-11-21 13:50:18 +11:00
Beaudan Brown
56a1c31bf4 Ensure we can still send messages to ourselves (sync) and disable group chats 2019-11-15 13:26:31 +11:00
Beaudan Brown
685ada5cc5 Merge branch 'clearnet' into prep-merge 2019-11-15 12:31:40 +11:00
Beaudan Brown
b7dd4257d6 Disable microphone button when you have disabled permissions 2019-11-12 09:53:31 +11:00
sachaaaaa
5529deb019
Merge pull request #602 from sachaaaaa/unpairing_device
[multi-device] Allow unpairing device
2019-11-07 13:37:17 +11:00
sachaaaaa
3f52b9df93 Make unpairing a toggle-able feature (enable with window.lokiFeatureFlags.multiDeviceUnpairing = true) 2019-11-06 14:54:23 +11:00
Beaudan Brown
41fdcef695 Ensure that we can't miss the apisReady event and only listen for single emit 2019-11-06 14:21:56 +11:00
Maxim Shishmarev
f4ed8b2bf3 Add a feature flag for private group chats 2019-11-01 12:43:01 +11:00
Maxim Shishmarev
0df5214979 Limit small private groups to 10 members 2019-11-01 12:00:29 +11:00
Beaudan Brown
6a512503f0 Update display name sanitisation to allow a bunch of languages and spaces 2019-10-28 12:45:13 +11:00
Beaudan Brown
4e70b66131 Extract the async token grab from the server api constructor and put in the factory. Fix up the areas this affects 2019-10-09 14:55:54 +11:00
Beaudan Brown
5d2f7ddb20 Add messages needed for UI, bit of house work 2019-10-09 14:51:12 +11:00
Maxim Shishmarev
4e39f1e0eb When composing: show mentions as profile names and treat them as indivisible elements 2019-09-30 16:50:22 +10:00
sachaaaaa
a931b2491a Merge branch 'clearnet' into PR_file_server
* clearnet:
  lint pass 2
  lint pass 1
  make sure versioning on write can't get out of sync
  Update js/modules/loki_public_chat_api.js
  Handle annotations omit correctly
  fix typo CI found
  refactor
  pollOnceForMessages() move lastGot up, address Sacha's review
  Update js/modules/loki_public_chat_api.js
  address reviews
  Custom message rendering of mentions
  lint and remove unneeded params
  modernize annotations since we're making a backward-incomp change
  sign and only show verified messages

# Conflicts:
#	js/modules/loki_public_chat_api.js
2019-09-25 13:49:10 +10:00
sachaaaaa
b13a4f3e56
Merge pull request #520 from msgmaxim/mentions2
Custom message rendering of mentions
2019-09-25 11:42:12 +10:00
sachaaaaa
7756d4f0f3 Merge branch 'clearnet' into PR_file_server
* clearnet:
  fix method
  separate out new/open, more lint/cleanup
  separate out note to self
  create window.mixpanel here
  use window.mixpanel, remove eventEmitter
  allow mixpanel to be already set up elsewhere
  Address review comments
  Add missing file in tests
  Add UI elements for searching and selecting members in a group chat
  Desktop Analytics
  Replaced value with a descriptive constant.
  Add comment to fix up confusion.
  Keep a cache of the last 5 fetched messages for public chat so we can use it to detect duplicate messages.

# Conflicts:
#	js/background.js
#	js/modules/loki_public_chat_api.js
2019-09-24 13:50:41 +10:00
Maxim Shishmarev
687e9db77b Custom message rendering of mentions 2019-09-23 11:00:51 +10:00
Ryan Tharp
3150a6ce11 separate out new/open, more lint/cleanup 2019-09-19 20:18:03 -07:00
Ryan Tharp
587df45086 create window.mixpanel here 2019-09-19 20:03:15 -07:00
sachaaaaa
e07f81c150 Add LokiFileServerAPI 2019-09-19 16:37:15 +10:00
Ryan Tharp
88b44390bf Desktop Analytics 2019-09-17 01:14:29 -07:00
Beaudan Brown
9beea2cbd3 Enforce curlies completely and lint with new settings 2019-09-05 11:48:10 +10:00
Mikunj
21dad58537 Linting. 2019-09-02 14:27:52 +10:00
Mikunj
a89358676c Update electron-context-menu.
Only allow copying QR code since saving doesn't work.
2019-09-02 12:32:43 +10:00
Ryan Tharp
c57571fdfd loki.network rss feed 2019-08-23 11:11:23 +10:00
Beaudan
014558d939 Squash and clean of old PRs, move towards sending cleartext again 2019-08-08 14:56:52 +10:00
Beaudan Campbell-Brown
73b417e605
Merge pull request #371 from BeaudanBrown/testnet
Separate testnet
2019-08-07 14:45:57 +10:00
Beaudan
492bb3723a Move pubkey truncation to loki_rpc and add window function 2019-08-07 13:57:17 +10:00
Maxim Shishmarev
cdd374a4b2 Add a toggle option for typing indicators; use short ttl for them 2019-08-06 11:57:45 +10:00
Beaudan
df2c4af67c Run lint and check for ip or address when removing unreachable nodes 2019-07-04 10:20:16 +10:00
Beaudan
87c5d0858c Choose a random seed node from a list for bootstrapping 2019-07-03 11:32:31 +10:00
sachaaaaa
c53633e367 Clearnet p2p with https (no verification yet) 2019-06-28 12:09:46 +10:00
Beaudan
d12f6b6d32 Handle swarm nodes the same for us or contacts, attach our key to message api object 2019-06-17 15:59:22 +10:00
Beaudan Campbell-Brown
971aef0c1b
Merge pull request #296 from BeaudanBrown/clearnet-seeds
Clearnet seeds
2019-06-12 11:19:34 +10:00
Beaudan Campbell-Brown
5c5155899e
Merge pull request #298 from BeaudanBrown/tls-fix
Have to put the tls setting here for some reason
2019-06-11 16:41:53 +10:00
Beaudan
6b2b9ce926 Remove default port and use port from storage server responses 2019-06-11 16:30:01 +10:00
Beaudan
eea2b8e6a7 Do port null check inside rpc call 2019-06-11 16:29:04 +10:00
Beaudan
8d4bfc27c9 Have to put the tls setting here for some reason 2019-06-11 14:59:23 +10:00
Beaudan
e520bf109a Persist PoW difficulty and update if get response from snodes 2019-06-03 13:37:34 +10:00
Mikunj
8808100796 Merge signal-1.24.0
# Conflicts:
#	.github/PULL_REQUEST_TEMPLATE.md
#	background.html
#	config/default.json
#	config/production.json
#	js/models/conversations.js
#	js/models/messages.js
#	js/views/conversation_view.js
#	js/views/inbox_view.js
#	js/views/settings_view.js
#	main.js
#	package.json
#	test/index.html
#	ts/components/conversation/ContactName.tsx
#	yarn.lock
2019-04-18 12:45:19 +10:00
Mikunj
3a8111020e Merge v1.23.0
# Conflicts:
#	background.html
#	package.json
#	yarn.lock
2019-04-18 11:12:02 +10:00
Mikunj
e343a04eea Merge commit '18b5b7c046436f2defab2e20407e22da180bf97b' into signal-1.22
# Conflicts:
#	app/sql.js
#	background.html
#	config/default.json
#	js/background.js
#	js/models/conversations.js
#	js/models/messages.js
#	js/modules/data.js
#	js/signal_protocol_store.js
#	js/views/conversation_search_view.js
#	libtextsecure/message_receiver.js
#	libtextsecure/sendmessage.js
#	main.js
#	package.json
#	preload.js
#	test/index.html
#	ts/components/Avatar.tsx
#	ts/components/conversation/ConversationHeader.md
#	ts/components/conversation/ConversationHeader.tsx
2019-04-17 11:59:54 +10:00
Beaudan
960bd3fff2 Move JobQueue to be a module so that we can use it in preload 2019-04-15 15:26:48 +10:00
Scott Nonnenberg
5a50786e7a Lint fixes 2019-04-10 12:14:32 -07:00
Gabe Stocco
851c1a0e47 Adding right click listener for URLs and Text Selections (#3197)
* Adds right-click listener

For urls and text selections

* Fixes build-release on windows

Should still be bash compatible too

* Update context menu line

Responding to feedback from @JaredPotter
2019-04-10 12:06:21 -07:00
Beaudan
531ee92dcb Updated messenger to work with slightly different storage server API and changed swarm requests to go through storage server 2019-04-08 13:37:20 +10:00
Scott Nonnenberg
c8ea2e9463 Download and install updates without the help of electron-updater 2019-04-05 17:18:37 -07:00
Scott Nonnenberg
7cfd3870d5 Escape XML delimiters for notifications on linux
Thanks to @whitequark for pointing out an inconsistency in the way that
some Linux desktop environments were displaying markup in notifications.
2019-03-18 16:30:53 -07:00
Beaudan
0d3c010cf7 I didn't realise there were 2 different windows between processes and I shouldn't have removed this 2019-03-04 12:36:19 +11:00
Beaudan Campbell-Brown
8e3542b511
Merge pull request #213 from sachaaaaa/channel_encryption
Hook up channel encryption
2019-03-04 12:19:34 +11:00
sachaaaaa
4714cafa6f
Merge pull request #238 from sachaaaaa/commit_hash_about
Show commit hash in About window for beta builds
2019-03-04 10:52:26 +11:00
sachaaaaa
37f0fced29 Show commit hash in About window for beta builds 2019-03-01 17:10:20 +11:00
Beaudan
5030ad4021 Made the slider label populate as well, plus removed redundant window function 2019-03-01 12:52:18 +11:00
sachaaaaa
aa722590fa use channel encryption with storage server 2019-02-27 14:04:15 +11:00
Mikunj
75d0894104 Fixed files not included in release.
Moved node relevant stuff in libloki into its own modules folder.
2019-02-22 12:00:04 +11:00
Scott Nonnenberg
ce9a52dde3 Remove unnecessary methods on window 2019-02-20 16:40:35 -08:00
Beaudan
6426a5eb9b Added ability to look up our .loki address and now send that with our LokiAddress messages 2019-02-14 13:09:04 +11:00
Beaudan
5d823de6f9 Renamed lokiSnodeAPI to start with lower case for consistency, refactor snode API to use conversation controller 2019-02-11 16:35:22 +11:00
Mikunj
725a41a8d7 Added link preview setting. 2019-02-08 14:58:31 +11:00
sachaaaaa
f900a08eda
Merge pull request #177 from sachaaaaa/merge_1_21_0
Merge Signal 1.21.0
2019-02-07 10:08:50 +11:00
sachaaaaa
a0f67c22da Merge branch 'textsecure/master' into merge_1_21_0
* textsecure/master: (26 commits)
  v1.21.0
  v1.21.0-beta.4
  Dark Theme: Preserve blue background on app loading screen
  Localization updates
  Fix width of audio player when window is very narrow
  A number of small fixes for Link Previews
  Get rid of the white flash when the app starts up (#3083)
  v1.21.0-beta.3
  Lint fixes
  Introduce new language: NB
  Fail over to all numbers in retry if errors don't have numbers
  Use the proper method for pulling attachments off disk for retry
  Fix rendering bug with verified state in updateVerified()
  Update electron-builder and electron-updater
  Ensure that dialog pops up when permissions denied for voice note
  Lint fixes
  Large update to localization strings
  Link Previews
  Ensure that blocked messages are dropped even after sealed sender
  Don't linkify quoted message contents
  ...

# Conflicts:
#	.github/PULL_REQUEST_TEMPLATE.md
#	_locales/cs/messages.json
#	background.html
#	config/default.json
#	index.html
#	js/models/conversations.js
#	js/modules/web_api.js
#	js/settings_start.js
#	js/views/conversation_view.js
#	js/views/settings_view.js
#	package.json
#	protos/SignalService.proto
#	stylesheets/_index.scss
#	stylesheets/_settings.scss
2019-02-06 13:53:20 +11:00
Beaudan
69ebf017ff Reworked loki_p2p_api to not use the window object, which means it needs to be instantiated after the storage is ready so that your pubkey can be passed in to the constructor. This makes it more modular and allows for easier testing 2019-02-06 10:26:25 +11:00
Mikunj
3c07d99a89 Fix variable names.
Fix module export to be more consistent.
2019-01-31 11:30:26 +11:00
Beaudan
07076c27ae Moved friend status to window, added start of p2p api stuff 2019-01-31 10:24:34 +11:00
Beaudan
b417edfc9b Added new protos for online broadcast messages, added db hits for getting friends, local server now instantiated on the window, now sending online broadcast messages when the local server starts 2019-01-31 10:24:34 +11:00
Scott Nonnenberg
813924685e Link Previews 2019-01-29 13:53:14 -08:00
Mikunj Varsani
b226feaac7
Merge pull request #148 from Mikunj/signal-1.20
Signal 1.20
2019-01-25 10:13:08 +11:00
Mikunj
69f51021b6 Travis windows fixes. 2019-01-24 14:47:38 +11:00
Mikunj
1a15ec9c15 Merge commit signal/master into signal-1.20 2019-01-22 13:54:03 +11:00
Mikunj
8c9b1a7a7a Added loki server.
Added test.
2019-01-21 15:23:20 +11:00
Mikunj
e08a63d078 Merge development into lint 2019-01-17 12:58:33 +11:00
Beaudan
7b1799c418 Big ol' hunk o' chunk. Now using random.snode to populate swarm lists, now making multiple requests from said lists and they are processed as they complete rather than waiting for all to resolve 2019-01-16 17:08:46 +11:00
Beaudan
37ba762312 First stuff for contacting specific nodes for each contact. Hard coded to hit the same bootstrap node for now plus doesn't handle unreachable nodes/errors well yet 2019-01-16 17:08:46 +11:00
Mikunj
6bd2d3962e Linted files 2019-01-16 16:18:08 +11:00
Mikunj
924c51d5c7 Removed min and max clamping in code.
This should be done UI and Server side instead.
2019-01-14 15:39:42 +11:00
Mikunj
87113b6cc1 Added message ttl setting storage 2019-01-11 15:59:44 +11:00
Scott Nonnenberg
e4babdaef0 Updates to backup infrastructure 2019-01-04 12:21:26 -08:00
Mikunj
3690f4acda Added timeout argument to WorkerInterface. 2018-12-19 14:05:57 +11:00
Mikunj
654b0dac84 Merge signal-master. 2018-12-17 12:56:04 +11:00
Beaudan
bb3ca610ff Cleaned up utilWorker spawning 2018-12-14 10:03:15 +11:00
Beaudan
6113f13d3a Rip the worker logic out of message_receiver and add the functionality for it to work with pow. Fix pow tests to work with those changes 2018-12-13 17:13:52 +11:00
Mikunj
26ba553e6a Added menu options to set, change and remove password. 2018-12-07 11:43:48 +11:00
Mikunj
f53bec38a5 Added password inputs on registration screen.
Fix case where db is deleted but password hash still remains which causes user to never register.
Allow password to have symbols and other characters.
Added more tests.

Moved passHash from config into the sqlite db.
We can do this because we assume if sql failed to initialise then the key provided was wrong and thus we can show the user the password page.
2018-12-06 15:47:37 +11:00
Mikunj
1cb09cad2a Add header options. 2018-12-04 08:47:09 +11:00
Mikunj
961eb53915 Auto-generate profile images on conversations. 2018-12-03 08:55:43 +11:00
Scott Nonnenberg
8add0ac8a1
Enable CI and packaged builds with Electron v3 (#2939)
* Update spectron to fix linux CI runs

* Point test-release grunt task at release folder

* Ensure that build folders of socks/smart-buffer are in build

* AppVeyor: windows build output folder is now release

* Travis: Force build output to release directory
2018-11-27 16:20:48 -08:00
Beaudan
bed9ce5be2 Added read receipt checkbox to the settings window which enables or disables the sending and receiving of read receipts 2018-11-22 16:49:15 +11:00
Mikunj
5f4a44ba8c Remove returning models from block/unblock.
lint fixes.
2018-11-20 11:36:44 +11:00
Mikunj
dbb92aa9c8 Added i18n messages. 2018-11-19 16:22:17 +11:00
Mikunj
ba390e354b Added unblocking.
Added styling.

Trigger changes on both conversation and messages when we block/unblock.
2018-11-19 16:08:01 +11:00
Mikunj
4d3fb17e61 Merge branch 'sig-development' into merge/signal 2018-11-14 15:06:46 +11:00
Beaudan
3aa135fdb4 Grabbing last hash from server response. only requesting messages after the lasthash. Keeping track of lasthash for array of nodes (currently hardcoded for one) 2018-11-14 13:09:33 +11:00
sachaaaaa
ad1cf94526 ES2015 classes for LokiServer and FallBackSessionCipher 2018-11-13 15:03:06 +11:00
Scott Nonnenberg
6300256a3e Gracefully shut down database operations before app exit 2018-11-12 15:31:17 -08:00
Mikunj
f589fdac5c Merge signal changes into branch. 2018-11-07 15:26:37 +11:00
sachaaaaa
4b9fcb98d4 Linting and other housekeeping stuff 2018-11-01 11:10:30 +11:00
Scott Nonnenberg
a7d78c0e9b Sealed Sender support
https://signal.org/blog/sealed-sender/
2018-10-29 14:49:18 -07:00
sachaaaaa
1ce29d77c3 Moved mnemonic to node side. Added sc_reduce32 (asm) to generate privkey. Moved mnemonic languages to separate files. 2018-10-24 17:04:54 +11:00
sachaaaaa
a418a9d23b allow registering using a mnemonic word list (seed used as privKey for now) 2018-10-24 10:13:54 +11:00
sachaaaaa
1e14022e2f Add skeleton for Loki Message API. Wrap data in json (for now?) 2018-08-21 19:44:30 +10:00
Scott Nonnenberg
5933a34a18 Use window.log in browser context, turn on console eslint rule 2018-07-21 14:52:43 -07:00
Scott Nonnenberg
f2a63c99ed Streamline code to clean logs based on version number 2018-07-20 15:49:51 -07:00
Scott Nonnenberg
c517e4193b New option: Disable spell check 2018-07-18 19:41:16 -07:00
Scott Nonnenberg
3c69886320 Finish new Message component, integrate into application
Also:
- New schema version 8 with video/image thumbnails, screenshots, sizes
- Upgrade messages not at current schema version when loading messages
  to show in conversation
- New MessageDetail react component
- New ConversationHeader react component
2018-07-17 15:58:07 -07:00
Scott Nonnenberg
d8e5e5fcf2 Open separate windows with theme, update settings theme on change 2018-07-13 08:57:30 -07:00
Scott Nonnenberg
ad4387803b New media permission, show dialog when not enabled for voice msg
UI now in separate renderer:
  - the permissions popup
  - settings dialog
  - debug log dialog
  - about window

Couple bug fixes:
  - About Window: Fix 'escape' to close window
  - Remove outdated dist/copy tasks from Gruntfile

Eslintified settings_view.js
2018-07-03 16:04:21 -07:00
Scott Nonnenberg
91e7155736
Restore version/environment details to about window (#2477) 2018-06-21 12:02:19 -07:00
Scott Nonnenberg
8eeaad8e18 Remove unused export/import functionality 2018-06-21 11:54:01 -07:00
Scott Nonnenberg
1c23c6a9d7 Remove window.config in favor of window.getXXX() accessors 2018-06-14 17:03:53 -07:00
Scott Nonnenberg
f3bd0cf903 Refactor api.js into web_api, which encapsulates all web access 2018-05-31 13:25:45 -07:00
Scott Nonnenberg
a58e94e17e Disable eval() since we never use it 2018-05-31 13:25:45 -07:00
Scott Nonnenberg
34f423b52c Remove unused code; move signal.js to js/modules for eslint
(noticed as I was doing this that signal.js doesn't get eslint coverage)
2018-05-23 16:26:48 -07:00
Scott Nonnenberg
a5416e42c4 Refactor all emoji utility methods into window.Signal.Emoji 2018-05-23 16:26:47 -07:00
Scott Nonnenberg
559b2157d4 Disable window.open(); has extra Electron functionalnity
(that we never use)

https://electronjs.org/docs/api/browser-window-proxy
2018-05-23 12:27:03 -07:00
Scott Nonnenberg
aa13a2c6f7 Parse phone numbers into e164 as part of schema upgrade 2018-05-10 11:54:58 -07:00
Scott Nonnenberg
9d1847a7e5 Pull all setup in preload.js into signal.js. goal: webpackable 2018-05-07 19:30:49 -07:00
Scott Nonnenberg
37821e5a1b Wire up all contact behaviors, refactor Contact type/selector 2018-05-07 19:11:35 -07:00
Scott Nonnenberg
41be7f126b Visuals for embedded contacts as well as contact detail screen 2018-05-07 19:09:55 -07:00
Daniel Gasienica
a102016ed8 Port Settings and OS to TypeScript 2018-05-02 20:01:57 -04:00
Daniel Gasienica
c591c3ca55 Use native notifications on all platforms 2018-05-02 19:58:33 -04:00
Daniel Gasienica
d5b391757d Add Notifications.getStatus 2018-05-02 19:18:33 -04:00
Daniel Gasienica
1dd87ad197 Format all source code using Prettier 2018-04-30 16:53:34 -04:00
Daniel Gasienica
b8d20052e1 Remove unnecessary AttachmentTS reference 2018-04-30 11:00:38 -04:00
Daniel Gasienica
e1b620602d Display attachments from disk 2018-04-27 16:31:43 -04:00
Daniel Gasienica
f56dc09d01 Add getAbsoluteAttachmentPath 2018-04-27 16:31:43 -04:00
Daniel Gasienica
b74b761255 Implement click to save for document list 2018-04-27 16:31:42 -04:00
Daniel Gasienica
41fe50553f Replace Backbone saveFile with Attachment.save 2018-04-27 16:31:42 -04:00
Daniel Gasienica
9134701f7c Move filesize from Bower to npm 2018-04-25 15:24:52 -04:00
Daniel Gasienica
4a5a2cb5c1 Replace Backbone with React lightbox 2018-04-25 15:24:51 -04:00
Daniel Gasienica
4ce0472b9f Extract Message.loadWithObjectURL 2018-04-25 15:24:51 -04:00
Daniel Gasienica
27c4bf90e3 Add Signal.Backbone 2018-04-25 15:24:51 -04:00
Daniel Gasienica
c46e1a1519 Move top-level functions to Signal.Util 2018-04-25 15:24:51 -04:00
Daniel Gasienica
32a3ef518b Render media gallery placeholder panel 2018-04-25 15:24:50 -04:00
Daniel Gasienica
df2e6e7864 Port MIME module to TypeScript 2018-04-25 15:24:50 -04:00
Scott Nonnenberg
c02860af5c
Responding to pull request review feedback
- messages.getQuoteObjectUrl: early return
- backup.js: explaining variables for long if statement
- types/messages.js: Log if thumbnail has neither data nor path
- sendmessage.js:
  - remove extraneous logging
  - fix indentation
  - upload attachments and thumbnails in parallel
- preload: don't load fs for tests, just fse
- _conversation.scss: split two selectors into two lines, 0px -> 0
- backup_test.js: use fse.existsSync and comment twoSlashes regex
- network_tests_view_test.js: Comment duplicate assignment to window.getSocketStatus
2018-04-23 15:36:47 -07:00
Scott Nonnenberg
a7d44d3344
Backup and end-to-end test! 2018-04-20 15:24:04 -07:00
Scott Nonnenberg
5412ce051e
preload.js: Fix quote support, load Quote properly 2018-04-13 18:10:49 -07:00
Scott Nonnenberg
b4ce79cac0
Reply -> Quote 2018-04-13 18:05:43 -07:00
Daniel Gasienica
ad05efb7a0 Expose Signal.Types.Conversation 2018-04-11 19:34:21 -04:00
Daniel Gasienica
55fc21505e Rename ts/test to ts/styleguide 2018-04-11 16:36:42 -04:00
Daniel Gasienica
ac50713f86 Improve auto-linking of URLs in messages
Fixes #598.
2018-04-11 16:36:42 -04:00
Scott Nonnenberg
c6c3b65bbc
Introduce React, TypeScript, TSLint and React-StyleGuidist (#2219)
Quite a bit of change here.

First, the basics:

- New dependencies were added: react, typescript, tslint, and react-styleguidist
- A new npm script: transpile. It uses typescript to process .tsx files in js/react, putting .js files next to the original file. It's part of the watch functionality of grunt dev as well as the default task run with just grunt (used to build the app prior to release). A lighter-weight to get watch behavior when just working on React components is to run yarn transpile --watch.
- yarn run clean-transpile will remove generated .js files


Style guide via react-styleguidist. Example site: https://react-styleguidist.js.org/examples/basic/

- Start with yarn styleguide
- Component.md files right next to the .tsx file
- jsdoc-style comments are picked up and added to the generated part of the styleguide - the overall summary and a table listing methods and properties of the component
- It has hot-reloading!
- It uses webpack, which means that our app now pulls in webpack though we don't use it to generate anything for the production app.
- I did a bunch of work to enable the use of Backbone views in this context, which will allow us to move smoothly from the old world to the new. First, add all the permutations in the old way, and then slowly start to re-render those same views with React.

A bit of dependency cleanup to enable use in React components:

- moment was moved from our Bower dependencies to our npm dependencies, so it can be used in React components not running in a browser window.
- i18n was moved into the new commonjs format, so it can be used in React components even if window is not available.

Lastly, a bit of Gruntfile cleanup:

- Removal of Chrome App-era modifications of background.js
- Make jshint/jscs watch more targeted, since more and more we'll be using other tools
2018-04-06 08:13:00 -07:00
Scott Nonnenberg
96bd90a4e0
Simplify assignment; add warning to preload.js about Style Guide 2018-04-05 17:16:15 -07:00
Scott Nonnenberg
05303233fb
window.Signal.React -> window.Signal.Components 2018-04-05 16:10:59 -07:00
Scott Nonnenberg
76be13552f
js/i18n.js -> js/modules/i18n.js 2018-04-05 12:51:29 -07:00
Daniel Gasienica
4c4443390a Rename createImporter to createAttachmentDataWriter 2018-04-04 19:11:46 -04:00
Scott Nonnenberg
893fb1cb9e
Introduce React/TypeScript/TSLint into app for new UI components
npm run transpile
  Works on files under js/react/
  Outputs files right next to the .tsx file

This is part of our `grunt dev` task, as well as the default grunt task,
which does everything else necessary to get a raw git checkout ready to
run.
2018-04-04 16:08:27 -07:00
Scott Nonnenberg
f86a6ef752
Update style of i18n, pull it in via preload instead of .html 2018-04-04 16:03:10 -07:00
Scott Nonnenberg
1ad2b080c8
Move moment from bower deps to npm deps 2018-04-04 16:00:38 -07:00
Daniel Gasienica
94c75762b5 Add Message.createAttachmentLoader 2018-04-04 18:41:50 -04:00
Daniel Gasienica
43ab320d31 Load attachments before writing them upon export 2018-04-04 18:41:50 -04:00
Daniel Gasienica
bf67254cc5 Add Message.createImporter 2018-04-04 18:41:50 -04:00
Daniel Gasienica
efd673083d Rename writeAttachmentData to writeNewAttachmentData 2018-04-04 18:41:50 -04:00
Daniel Gasienica
ce8fe0d345 Add Signal.Startup module 2018-04-04 18:10:52 -04:00
Daniel Gasienica
8474f3cf7f Use create* prefix to clarify curried functions 2018-04-03 15:25:24 -04:00
Daniel Gasienica
6e6b93d917 Run ESLint on preload.js 2018-04-03 15:03:57 -04:00
Daniel Gasienica
805031ade8 Conditionally run post-attachment migrations
Introduce placeholder migrations for Backbone models so they never implicitly
run migrations whenever they are `fetch`ed. We prefer to run our migrations
explicitly upon app startup and then let Backbone models be (slightly) dumb(er)
models, without inadvertently triggering migrations.
2018-04-02 17:42:04 -04:00
Daniel Gasienica
d3c9de4712 Add debug module
Lets us generate large conversations with large attachments.
2018-04-02 12:17:36 -04:00
Daniel Gasienica
ce8fd3d847 Expose Signal.Settings module 2018-04-02 12:17:36 -04:00
Daniel Gasienica
02354ce655 Expose Signal.Database module 2018-04-02 12:17:36 -04:00
Daniel Gasienica
a18e462817 Move migrations to Signal.Migrations 2018-04-02 12:17:36 -04:00
Daniel Gasienica
c765422fa1 Extract deferredToPromise 2018-04-02 12:17:36 -04:00
Daniel Gasienica
d16178638e Split database migrations into pre- and post-attachment migration
- Run light-weight migrations before attachment migration.
- Run regular migrations after attachments have been moved to disk.
2018-04-02 12:17:36 -04:00
Daniel Gasienica
add19aa732 Add initialization view 2018-03-26 16:56:37 -04:00
Daniel Gasienica
1c4b7eb01c Make namespace generation clearer
Let’s make it clear that this is where we initialize our namespaces to avoid
proliferation of various initialization points now that we support CommonJS.
2018-03-26 16:56:20 -04:00
Daniel Gasienica
7c2fde4433 Add Signal.Workflow namespace 2018-03-26 16:49:21 -04:00
Daniel Gasienica
5c9f18e1ae Wire up background message migration 2018-03-26 16:49:21 -04:00
Daniel Gasienica
d13668544d Rename IdleListener to IdleDetector 2018-03-26 16:49:21 -04:00
Daniel Gasienica
92ace67846 Start idle listener on startup 2018-03-26 16:49:21 -04:00
Daniel Gasienica
0c06fff47b Wire up Message / Attachment migration functions on startup
Makes `migrationContext` obsolete.
2018-03-26 16:38:34 -04:00
Daniel Gasienica
9d25aa4e43 Delete attachment files on disk upon message delete 2018-03-26 16:38:34 -04:00
Daniel Gasienica
1c8123ff1a Move writeAttachmentData into Attachments
Encapsulates all attachment operations that require Node.js / Electron APIs,
e.g. file system access.
2018-03-26 16:38:34 -04:00
Daniel Gasienica
e0428355be Wire up writeAttachment 2018-03-26 16:38:34 -04:00
Scott Nonnenberg
cea42bde7d
Encryption support for backup and restore
Also moved to the _ prefix in backup.js for all private methods exported
for testing.
2018-03-20 11:53:54 -07:00
Scott Nonnenberg
e583434366
Refactor: Move Backup under window.Signal 2018-03-20 11:53:19 -07:00
Daniel Gasienica
ac31dcbd75 Expose Signal.Migrations namespace 2018-03-19 19:27:59 -04:00
Scott Nonnenberg
26c273618a
Refactor: db tasks to database.js, log delete to modules/logs.js 2018-03-14 14:42:15 -07:00
Scott Nonnenberg
3a151393c5
Move wrapDeferred from background.js to preload.js
It's necessary anywhere that will have to deal with Deferreds.
2018-03-14 14:42:14 -07:00
Scott Nonnenberg
928906e0f3
Enable deletion of all logs on disk via IPC 2018-03-14 14:42:13 -07:00
Daniel Gasienica
289063b24b Expose Signal.Types.Errors 2018-03-08 16:22:38 -05:00
Daniel Gasienica
21339c6866 Add Settings type 2018-03-05 10:29:11 -05:00
Daniel Gasienica
91daedd619 Add OS module 2018-03-05 10:29:11 -05:00
Daniel Gasienica
3df22026ab UX Improvements: Global Menu & Copy Changes (#2078)
- [x] Removed ‘Restart Signal’ global menu item
- [x] Change _Click to create contact…_ to _Start conversation…_
- [x] Move global menu (top-left kebab) into OS menu bar,
      i.e. **Settings** > **Preferences…**
- [x] Add tests for OS menu bar templates
- [x] Fix bug with **Window** menu on macOS when showing setup options
- [x] Use _Title Case_ for all OS menu bar menu items for consistency

commit dedf7c9af0de90980388559659df0d92a77b864c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:53:42 2018 -0500

    Use ‘Title Case’ to be consistent with OS menus

    References:
    - Apple:
        - https://developer.apple.com/macos/human-interface-guidelines/menus/menu-anatomy/#menu-and-menu-item-titles
        - https://developer.apple.com/library/content/documentation/FinalCutProX/Conceptual/FxPlugHIG/TextStyleGuidelines/TextStyleGuidelines.html#//apple_ref/doc/uid/TP40013782-CH6-SW1
    - https://titlecaseconverter.com/

commit 3286da29b334bd4526c587b17707c2f230cec8f5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:36:50 2018 -0500

    Fix bug for macOS ‘Window’ menu with setup options

commit 236a23d1eafe2a16073394a27b9013298b682a25
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:27:46 2018 -0500

    Test menus with included setup options

commit c5d5f5abb8d7f52d6a4aa182a86c92f7ddceade0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:10:27 2018 -0500

    Move settings (‘Preferences’) into OS-level menu

    This reduces our reliance on custom UI until we have more design resources.

commit 027803f8f4983cffa443f0beff1854dcf541689b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 16:02:56 2018 -0500

    Prepare tests for menu with/without included setup

commit 9e2f006924b85eb249a8a1261c1c4dd1a706afa6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 15:55:46 2018 -0500

    Destructure `includeSetup`

commit 6b2a1eccdf724fd722e58415d2700da73942d9e8
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 15:55:14 2018 -0500

    🔤 `createTemplate` `options`

commit c2fecba34b153fed106f414ed3347d46299f6fe5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:49:55 2018 -0500

    Test menu for Windows and Linux

commit 60281b1af9ad1f022cdbc40711ebd0b688a7355d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:40:39 2018 -0500

    Add `yarn run test-app` command

commit 1a0489919c0a97b03fe88196260fef894fb3d9e4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:40:29 2018 -0500

    Add test for `SignalMenu.createTemplate` on macOS

commit 9638b86c0f00f231e44562a5aa01626f0e5fdd8b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 12:34:46 2018 -0500

    Make `createTemplate` pure

    Extracting `options.platform` makes it easier to test without having to
    stub `process.platform`.

commit 9c26404892d7c9a7bd0199a9e8367a165a3b365c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:47:39 2018 -0500

    Extract `locale.load` `appLocale` & `logger` for testability

    This allows us to run this code in a non-Electron environment, e.g. Node.js
    Mocha test suite.

commit 710b22438df25c8d5e8431845a035c55ec8fc0b7
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:46:13 2018 -0500

    🔤 npm scripts

commit 9ae22937fbce078f91443023b560b3c0468c1380
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:45:30 2018 -0500

    Use 2-space indendation for `app` module tests

commit 22c26baf6159bd2e1f5a787c10e2260f09395329
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:22:55 2018 -0500

    Prefer named exports

commit 9c9526195266ac77ac2ca04135a1e675f617dfd2
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:22:46 2018 -0500

    🔤 Organize `require`s

commit 2f144d24d9e9a9ef72fe418996e3c911b304b00a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 27 11:13:50 2018 -0500

    Remove existing global hamburger menu

    This will be replaced by a OS-level ‘Preferences’ menu.

commit f5adb374cb742e5f319ececda8ab6d8adee88d7e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 18:40:54 2018 -0500

    Remove ‘Restart Signal’ menu from settings

    Apparently, this is a remnant from the Chrome web application.

commit d7a206bc8e67ef44022085e804ca040ed1b219f7
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 17:16:49 2018 -0500

    Clarify label for starting a new conversation

    When user a enters a number that is not a contact, we prompt them to start a new
    conversation.

commit 715a4064367fb61d85c1a4f9d48261b2ce002435
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 26 16:46:26 2018 -0500

    Use ‘Enter name or number’ as prompt’

    This follows implementation of Android and recommendation from Alissa.
2018-03-02 15:59:39 -05:00
Scott Nonnenberg
426dab85a2
New design for import/install, 'light' import (#2053)
- A new design for the import flow. It features:
  - Icons at the top of every screen
  - Gray background, blue buttons, thinner text
  - Simpler copy
- A new design for the install flow. It features:
  - Immediate entry into the QR code screen
  - Animated dots to show that we're loading the QR code from the server
  - Fewer screens: 1) QR 2) device name 3) sync-in-progress
- When not set up, the app opens directly into the install screen, which has been streamlined. The `--import` command-line argument will cause the app to open directly into the import flow.
- Support for two different flavors of builds - the normal build will open into the standard registration flow, and the import flavor will be exactly the same except during setup it will open directly into the import flow.
- A new design for the (dev-only) standalone registration view
- When these install sequences are active, the OS File menu has entries to allow you to switch the method of setup you'd like to use. These go away as soon as the first step is taken in any of these flows.
- The device name (chosen on initial setup) is now shown in the settings panel
- At the end of a light import, we hand off to the normal device link screen, starting at the QR code. On a full import, we remove the sensitive encryption information in the export to prevent conflicts on multiple imports.
- `Whisper.Backup.exportToDirectory()` takes an options object so you can tell it to do a light export.
- `Whisper.Backup.importFromDirectory()` takes an options object so you can force it to load only the light components found on disk. It also returns an object so you can tell whether a given import was a full import or light import.
- On start of import, we build a list of all the ids present in the messages, conversations, and groups stores in IndexedDB. This can take some time if a lot of data is in the database already, but it makes the subsequent deduplicated import very fast.
- Disappearing messages are now excluded when exporting
- Remove some TODOs in the tests
2018-02-22 10:40:32 -08:00
Daniel Gasienica
a0da73ca8d Auto-orient image attachments based on EXIF metadata
As described in #998, images are sometimes displayed with an incorrect
orientation. This is because cameras often write files in the native sensor byte
order and attach the `Orientation` EXIF metadata to tell end-user devices how to
display the images based on the original author’s capture orientation.

Electron/Chromium (and therefore Signal Desktop) currently doesn’t support
applying this metadata for `<img>` tags, e.g. CSS `image-orientation: from-
image`. As a workaround, this change uses the `loadImage` library with the
`orientation: true` flag to auto-orient images ~~before display~~ upon receipt
and before sending.

**Changes**
- [x] ~~Auto-orient images during display in message list view~~
  - [x] Ensure image is not displayed until loaded (to prevent layout reflow) .
- [x] Auto-orient images upon receipt and before storing in IndexedDB
      (~~or preserve original data until Chromium offers native fix?~~)
- [x] Auto-orient images in compose area preview.
- [x] ~~Auto-orient images in lightbox view~~
- [x] Auto-orient images before sending / storage.
- [x] Add EditorConfig for sharing code styles across editors.
- [x] Fix ESLint ignore file.
- [x] Change `function-paren-newline` ESLint rule from
      `consistent` to `multiline`.
- [x] Add `operator-linebreak` ESLint rule for consistency.
- [x] Added `blob-util` dependency for converting between array buffers,
      blobs, etc.
- [x] Extracted `createMessageHandler` to consolidate logic for
      `onMessageReceived` and `onSentMessage`.
- [x] Introduce `async` / `await` to simplify async coding (restore control flow
      for branching, loops, and exceptions).
- [x] Introduce `window.Signal` namespace for exposing ES2015+ CommonJS modules.
- [x] Introduce rudimentary `Message` and `Attachment` types to begin defining a
      schema and versioning. This will allow us to track which changes, e.g.
      auto-orient JPEGs, per message / attachment as well as which fields
    are stored.
- [x] Renamed `window.dataURLtoBlob` to `window.dataURLToBlobSync` to both fix
      the strange `camelCase` as well as to highlight that this operation is
      synchronous and therefore blocks the user thread.
- [x] Normalize all JPEG MIME types to `image/jpeg`, eliminating the
      invalid `image/jpg`.
- [x] Add `npm run test-modules` command for testing non-browser specific
      CommonJS modules.
- **Stretch Goals**
  - [ ] ~~Restrict `autoOrientImage` to `Blob` to narrow API interface.~~ Do
        this once we use PureScript.
  - [ ] ~~Return non-JPEGs as no-op from `autoOrientImage`.~~ Skipping
        `autoOrientImage` for non-JPEGs altogether.
  - [ ] Retroactively auto-orient existing JPEG image attachments in the
        background.

---

Fixes #998

---

- **Blog:** EXIF Orientation Handling Is a Ghetto:
    https://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/
- **Chromium Bug:** EXIF orientation is ignored:
    https://bugs.chromium.org/p/chromium/issues/detail?id=56845
- **Chromium Bug:** Support for the CSS image-orientation CSS property:
    https://bugs.chromium.org/p/chromium/issues/detail?id=158753

---

commit ce5090b473a2448229dc38e4c3f15d7ad0137714
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 16 10:35:36 2018 -0500

    Inline message descriptors

commit 329036e59c138c1e950ec7c654eebd7d87076de5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:34:40 2018 -0500

    Clarify order of operations

    Semantically, it makes more sense to do `getFile` before `clearForm`
    even though it seems to work either way.

commit f9d4cfb2ba0d8aa308b0923bbe6066ea34cb97bd
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:18:26 2018 -0500

    Simplify `operator-linebreak` configuration

    Enabling `before` caused more code changes and it turns out our previous
    configuration is already the default.

commit db588997acdd90ed2ad829174ecbba744383c78b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:15:59 2018 -0500

    Remove obsolete TODO

commit 799c8817633f6afa0b731fc3b5434e463bd850e3
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:12:18 2018 -0500

    Enable ESLint `function-paren-newline` `multiline`

    Per discussion.

commit b660b6bc8ef41df7601a411213d6cda80821df87
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Thu Feb 15 17:10:48 2018 -0500

    Use `messageDescriptor.id` not `source`

commit 5e7309d176f4a7e97d3dc4c738e6b0ccd4792871
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 16:29:01 2018 -0500

    Remove unnecessary `eslint-env`

commit 393b3da55eabd7413596c86cc3971b063a0efe31
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 16:19:17 2018 -0500

    Refactor `onSentMessage` and `onMessageReceived`

    Since they are so similar, we create the handlers using new
    `createMessageHandler` function. This allows us to ensure both synced and
    received messages go through schema upgrade pipeline.

commit b3db0bf179c9a5bea96480cde28c6fa7193ac117
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 16:18:21 2018 -0500

    Add `Message` descriptor functions

commit 8febf125b1b42fe4ae1888dd50fcee2749dc1ff0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 14:46:56 2018 -0500

    Fix typo

commit 98d951ef77bd578b313a4ff4b496b793e82e88d5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 12:22:39 2018 -0500

    Remove `promises` reference

commit a0e9559ed5bed947dabf28cb672e63d39948d854
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 12:22:13 2018 -0500

    Fix `AttachmentView::mediaType` fall-through

commit 67be916a83951b8a1f9b22efe78a6da6b1825f38
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 12:03:41 2018 -0500

    Remove minor TODOs

commit 0af186e118256b62905de38487ffacc41693ff47
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:44:41 2018 -0500

    Enable ESLint for `js/views/attachment_view.js`

commit 28a2dc5b8a28e1a087924fdc7275bf7d9a577b92
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:44:12 2018 -0500

    Remove dynamic type checks

commit f4ce36fcfc2737de32d911cd6103f889097813f6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:27:56 2018 -0500

    Rename `process` to `upgradeSchema`

    - `Message.process` -> `Message.upgradeSchema`
    - `Attachment.process` -> `Attachment.upgradeSchema`
    - `Attachment::processVersion` -> `Attachment::schemaVersion`

    Document version history.

commit 41b92c0a31050ba05ddb1c43171d651f3568b9ac
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:11:50 2018 -0500

    Add `operator-linebreak` ESLint rule

    Based on the following discussion:
    https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r168029106

commit 462defbe55879060fe25bc69103d4429bae2b2f6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Wed Feb 14 11:01:30 2018 -0500

    Add missing `await` for `ConversationController.getOrCreateAndWait`

    Tested this by setting `if` condition to `true` and confirming it works.
    It turns rotating a profile key is more involved and might require
    registering a new account according to Matthew.

commit c08058ee4b883b3e23a40683de802ac81ed74874
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 16:32:24 2018 -0500

    Convert `FileList` to `Array`

commit 70a6c4201925f57be1f94d9da3547fdefc7bbb53
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 15:46:34 2018 -0500

    🎨 Fix lint errors

commit 2ca7cdbc31d4120d6c6a838a6dcf43bc209d9788
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 15:07:09 2018 -0500

    Skip `autoOrientImage` for non-JPEG images

commit 58eac383013c16ca363a4ed33dca5c7ba61284e5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 14:55:35 2018 -0500

    Move new-style modules to `window.Signal` namespace

commit 02c9328877dce289d6116a18b1c223891bd3cd0b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 14:35:23 2018 -0500

    Extract `npm run test-modules` command

commit 2c708eb94fba468b81ea9427734896114f5a7807
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:25:51 2018 -0500

    Extract `Message.process`

commit 4a2e52f68a77536a0fa04aa3c29ad3e541a8fa7e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:25:12 2018 -0500

    Fix EditorConfig

commit a346bab5db082720f5d47363f06301380e870425
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:13:02 2018 -0500

    Remove `vim` directives on ESLint-ed files

commit 7ec885c6359e495b407d5bc3eac9431d47c37fc6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 13:08:24 2018 -0500

    Remove CSP whitelisting of `blob:`

    We no longer use `autoOrientImage` using blob URLs. Bring this back if we
    decide to auto-orient legacy attachments.

commit 879b6f58f4a3f4a9ed6915af6b1be46c1e90e0ca
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:57:05 2018 -0500

    Use `Message` type to determine send function

    Throws on invalid message type.

commit 5203d945c98fd2562ae4e22c5c9838d27dec305b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:56:48 2018 -0500

    Whitelist `Whisper` global

commit 8ad0b066a3690d3382b86bf6ac00c03df7d1e20b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:56:32 2018 -0500

    Add `Whisper.Types` namespace

    This avoids namespace collision for `Whisper.Message`.

commit 785a949fce2656ca7dcaf0869d6b9e0648114e80
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:55:43 2018 -0500

    Add `Message` type

commit 674a7357abf0dcc365455695d56c0479998ebf27
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:35:23 2018 -0500

    Run ESLint on `Conversation::sendMessage`

commit cd985aa700caa80946245b17ea1b856449f152a0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:34:38 2018 -0500

    Document type signature of `FileInputView::readFile`

commit d70d70e52c49588a1dc9833dfe5dd7128e13607f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:31:16 2018 -0500

    Move attachment processing closer to sending

    This helps ensure processing happens uniformly, regardless of which code
    paths are taken to send an attachment.

commit 532ac3e273a26b97f831247f9ee3412621b5c112
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:22:29 2018 -0500

    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`?

commit a4582ae2fb6e1d3487131ba1f8fa6a00170cb32c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 12:21:42 2018 -0500

    Refactor `getFile` and `getFiles`

    Lint them using ESLint.

commit 07e9114e65046d791fc4f6ed90d6e2e938ad559d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:37:31 2018 -0500

    Document incoming and outgoing attachments fields

    Note how outgoing message attachments only have 4 fields. This presumably
    means the others are not used in our code and could be discarded for
    simplicity.

commit fdc3ef289d6ec1be344a12d496839d5ba747bb6a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:36:21 2018 -0500

    Highlight that `dataURLToBlob` is synchronous

commit b9c6bf600fcecedfd649ef2ae3c8629cced4e45a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:35:49 2018 -0500

    Add EditorConfig configuration

commit e56101e229d56810c8e31ad7289043a152c6c449
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:34:23 2018 -0500

    Replace custom with `blob-util` functions

    IMPORTANT: All of them are async so we need to use `await`, otherwise we get
    strange or silent errors.

commit f95150f6a9569fabcb31f3acd9f6b7bf50b5d145
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:17:30 2018 -0500

    Revert "Replace custom functions with `blob-util`"

    This reverts commit 8a81e9c01bfe80c0e1bf76737092206c06949512.

commit 33860d93f3d30ec55c32f3f4a58729df2eb43f0d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:13:02 2018 -0500

    Revert "Replace `blueimp-canvas-to-blob` with `blob-util`"

    This reverts commit 31b3e853e4afc78fe80995921aa4152d9f6e4783.

commit 7a0ba6fed622d76a3c39c7f03de541a7edb5b8dd
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 11:12:58 2018 -0500

    Replace `blueimp-canvas-to-blob` with `blob-util`

commit 47a5f2bfd8b3f546e27e8d2b7e1969755d825a66
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:55:34 2018 -0500

    Replace custom functions with `blob-util`

commit 1cfa0efdb4fb1265369e2bf243c21f04f044fa01
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:47:02 2018 -0500

    Add `blob-util` dependency

commit 9ac26be1bd783cd5070d886de107dd3ad9c91ad1
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:46:44 2018 -0500

    Document why we drop original image data during auto-orient

commit 4136d6c382b99f41760a4da519d0db537fa7de8d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:46:27 2018 -0500

    Extract `DEFAULT_JPEG_QUALITY`

commit 4a7156327eb5f94dba80cb300b344ac591226b0e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 10:37:11 2018 -0500

    Drop support for invalid `image/jpg` MIME type

commit 69fe96581f25413194032232f1bf704312e4754c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:54:30 2018 -0500

    Document `window.onInvalidStateError` global

commit a48ba1c77458da38583ee9cd488f70a59f6ee0fd
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:54:04 2018 -0500

    Selectively run ESLint on `js/background.js`

    Enabling ESLint on a per function basis allows us to incrementally improve
    the codebase without requiring large and potentially risky refactorings.

commit e6d1cf826befc17ad4ec72fda8e761701665635e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:16:23 2018 -0500

    Move async attachment processing to `onMessageReceived`

    We previously processed attachments in `handleDataMessage` which is mostly a
    synchronous function, except for the saving of the model. Moving the
    processing into the already async `onMessageReceived` improves code clarity.

commit be6ca2a9aae5b59c360817deb1e18d39d705755e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:14:49 2018 -0500

    Document import of ES2015+ modules

commit eaaf7c41608fb988b8f4bbaa933cff110115610e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:14:29 2018 -0500

    🎨 Fix lint error

commit a25b0e2e3d0f72c6a7bf0a15683f02450d5209ee
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:13:57 2018 -0500

    🎨 Organize `require`s

commit e0cc3d8fab6529d01b388acddf8605908c3d236b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 09:07:17 2018 -0500

    Implement attachment process version

    Instead of keeping track of last normalization (processing) date, we now
    keep track of an internal processing version that will help us understand
    what kind of processing has already been completed for a given attachment.
    This will let us retroactively upgrade existing attachments.

    As we add more processing steps, we can build a processing pipeline that can
    convert any attachment processing version into a higher one,
    e.g. 4 -> 5 -> 6 -> 7.

commit ad9083d0fdb880bc518e02251e51a39f7e1c585f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:50:31 2018 -0500

    Ignore ES2015+ files during JSCS linting

commit 96641205f734927aaebc2342d977c555799c3e3b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:48:07 2018 -0500

    Improve ESLint ignore rules

    Apparently, using unqualified `/**` patterns prevents `!` include patterns.
    Using qualified glob patterns, e.g. `js/models/**/*.js`, lets us work
    around this.

commit 255e0ab15bd1a0ca8ca5746e42d23977c8765d01
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:44:59 2018 -0500

    🔤 ESLint ignored files

commit ebcb70258a26f234bd602072ac7c0a1913128132
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:35:47 2018 -0500

    Whitelist `browser` environment for ESLint

commit 3eaace6f3a21421c5aaaaf01592408c7ed83ecd3
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:35:05 2018 -0500

    Use `MIME` module

commit ba2cf7770e614415733414a2dcc48f110b929892
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:32:54 2018 -0500

    🎨 Fix lint errors

commit 65acc86e8580e88f7a6611eb4b8fa5d7291f7a3f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:30:42 2018 -0500

    Add ES2015+ files to JSHint ignored list

commit 8b6494ae6c9247acdfa059a9b361ec5ffcdb39f0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:29:20 2018 -0500

    Document potentially unexpected `autoScale` behavior

commit 8b4c69b2002d1777d3621be10f92cbf432f9d4d6
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:26:47 2018 -0500

    Test CommonJS modules separately

    Not sure how to test them as part of Grunt `unit-tests` task as
    `test/index.html` doesn’t allow for inclusion of CommonJS modules that use
    `require`. The tests are silently skipped.

commit 213400e4b2bba3efee856a25b40e269221c3c39d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Tue Feb 13 08:24:27 2018 -0500

    Add `MIME` type module

commit 37a726e4fb4b3ed65914463122a5662847b5adee
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:18:05 2018 -0500

    Return proper `Error` from `blobArrayToBuffer`

commit 164752db5612220e4dcf58d57bcd682cb489a399
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:15:41 2018 -0500

    🎨 Fix ESLint errors

commit d498dd79a067c75098dd3179814c914780e5cb4f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:14:33 2018 -0500

    Update `Attachment` type field definitions

commit 141155a1533ff8fb616b70ea313432781bbebffd
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 20:12:50 2018 -0500

    Move `blueimp-canvas-to-blob` from Bower to npm

commit 7ccb833e5d286ddd6235d3e491c62ac1e4544510
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:33:50 2018 -0500

    🎨 Clarify data flow

commit e7da41591fde5a830467bebf1b6f51c1f7293e74
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:31:21 2018 -0500

    Use `blobUrl` for consistency

commit 523a80eefe0e2858aa1fb2bb9539ec44da502963
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:28:06 2018 -0500

    Remove just-in-time image auto-orient for lightbox

    We can bring this back if our users would like auto-orient for old
    attachments.

commit 0739feae9c47dd523c10740d6cdf746d539f270c
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:27:21 2018 -0500

    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.

commit ed43c66f92830ee233d5a94d0545eea4da43894d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:26:24 2018 -0500

    Auto-orient JPEG attachments upon receipt

commit e2eb8e36b017b048d57602fca14e45d657e0e1a1
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:25:26 2018 -0500

    Expose `Attachment` type through `Whisper.Attachment`

commit 9638fbc987b84f143ca34211dc4666d96248ea2f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:23:39 2018 -0500

    Use `contentType` from `model`

commit 032c0ced46c3876cb9474b26f9d53d6f1c6b16a0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:23:04 2018 -0500

    Return `Error` object for `autoOrientImage` failures

commit ff04bad8510c4b21aef350bed2b1887d0e055b98
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:22:32 2018 -0500

    Add `options` for `autoOrientImage` output type / quality

commit 87745b5586d1e182b51c9f9bc5e4eaf6dbc16722
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:18:46 2018 -0500

    Add `Attachment` type

    Defines various functions on attachments, e.g. normalization
    (auto-orient JPEGs, etc.)

commit de27fdc10a53bc8882a9c978e82265db9ac6d6f5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 16:16:34 2018 -0500

    Add `yarn grunt` shortcut

    This allows us to use local `grunt-cli` for `grunt dev`.

commit 59974db5a5da0d8f4cdc8ce5c4e3c974ecd5e754
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 10:10:11 2018 -0500

    Improve readability

commit b5ba96f1e6f40f2e1fa77490c583217768e1f412
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 10:08:12 2018 -0500

    Use `snake_case` for module names

    Prevents problems across case-sensitive and case-insensitive file systems.

    We can work around this in the future using a lint rule such as
    `eslint-plugin-require-path-exists`.
    See discussion:
    https://github.com/signalapp/Signal-Desktop/pull/2040#discussion_r167365931

commit 48c5d3155c96ef628b00d99b52975e580d1d5501
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Mon Feb 12 10:05:44 2018 -0500

    🎨 Use destructuring

commit 4822f49f22382a99ebf142b337375f7c25251d76
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:41:40 2018 -0500

    Auto-orient images in lightbox view

commit 7317110809677dddbbef3fadbf912cdba1c010bf
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:40:14 2018 -0500

    Document magic number for escape key

commit c790d07389a7d0bbf5298de83dbcfa8be1e7696b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:38:35 2018 -0500

    Make second `View` argument an `options` object

commit fbe010bb63d0088af9dfe11f153437fab34247e0
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 17:27:40 2018 -0500

    Allow `loadImage` to fetch `blob://` URLs

commit ec35710d002b019a273eeb48f94dcaf2babe5d96
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:57:48 2018 -0500

    🎨 Shorten `autoOrientImage` import

commit d07433e3cf316c6a143a0c9393ba26df9e3af17b
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:57:19 2018 -0500

    Make `autoOrientImage` module standalone

commit c285bf5e33cdf10e0ef71e72cd6f55aef0df96ef
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:55:44 2018 -0500

    Replace `loadImage` with `autoOrientImage`

commit 44318549235af01fd061c25f557c93fd21cebb7a
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:53:23 2018 -0500

    Add `autoOrientImage` module

    This module exposes `loadImage` with a `Promise` based interface and pre-
    populates `orientation: true` option to auto-orient input. Returns data URL
    as string.

    The module uses a named export as refactoring references of modules with
    `default` (`module.exports`) export references can be error-prone.
    See: https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html

commit c77063afc6366fe49615052796fe46f9b369de39
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:44:30 2018 -0500

    Auto-orient preview images

    See: #998

commit 06dba5eb8f662c11af3a9ba8395bb453ab2e5f8d
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:43:23 2018 -0500

    TODO: Use native `Canvas::toBlob`

    One challenge is that `Canvas::toBlob` is async whereas
    `dataURLtoBlob` is sync.

commit b15c304a3125dd023fd90990e6225a7303f3596f
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 16:42:45 2018 -0500

    Make `null` check strict

    Appeases JSHint. ESLint has a nice `smart` option for `eqeqeq` rule:
    https://eslint.org/docs/rules/eqeqeq#smart

commit ea70b92d9b18201758e11fdc25b09afc97b50055
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 15:23:58 2018 -0500

    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

commit 62fd744f9f27d951573a68d2cdfe7ba2a3784b41
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:38:04 2018 -0500

    Use CSS to constrain auto-oriented images

commit f4d3392687168c237441b29140c7968b49dbef9e
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:35:02 2018 -0500

    Replace `ImageView` `el` with auto-oriented `canvas`

    See: #998

commit 1602d7f610e4993ad1291f88197f9ead1e25e776
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:25:48 2018 -0500

    Pass `Blob` to `View` (for `ImageView`)

    This allows us to do JPEG auto-orientation based on EXIF metadata.

commit e6a414f2b2a80da1137b839b348a38510efd04bb
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 14:25:12 2018 -0500

    🔪 Remove newline

commit 5f0d9570d7862fc428ff89c2ecfd332a744537e5
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 11:17:02 2018 -0500

    Expose `blueimp-load-image` as `window.loadImage`

commit 1e1c62fe2f6a76dbcf1998dd468c26187c9871dc
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 11:16:46 2018 -0500

    Add `blueimp-load-image` npm dependency

commit ad17fa8a68a21ca5ddec336801b8568009bef3d4
Author: Daniel Gasienica <daniel@gasienica.ch>
Date:   Fri Feb 9 11:14:40 2018 -0500

    Remove `blueimp-load-image` Bower dependency
2018-02-21 10:28:13 -05:00
Martino Pilia
7034d8759d Add badge for unread messages to the tray icon (#1934)
This commit adds a badge to the tray icon that displays the number of
unread messages, if there is any. It is implemented by providing
alternative versions of the icon, that replace the default image when a
message is received.

The badge is rendered graphically as a red circle containing the number
of unread messages. Since a different icon file is needed for each
possible number of unread messages, but this number is clearly
unbounded, only the numbers from 1 to 9 are provided. If there are 10 or
more unread messages, a single badge (depicted as "9+") is used.

Resolves #1917
2018-01-17 15:27:58 -08:00
Scott Nonnenberg
b17a67ec65
Support pass-through proxies with HTTPS_PROXY env var (#1878)
We've simplified; HTTPS_PROXY or https_proxy is used for all requests.

We also require that only our self-signed certificates are used for
secure traffic. That rules out all SSL-terminating MITM proxies, since
we don't trust their root certificate.

Once we're sure that this system works for people, we'll improve config
on MacOS and Windows.
2017-12-08 10:38:01 -08:00
Scott Nonnenberg
acc94edd23
Add proxy support based on environment variables (#1855)
We pull proxy settings from environment variables:

- HTTPS_PROXY for sending, profile pulls, and attachment download/upload
- WSS_PROXY for connecting to the websocket for receiving messages
- ALL_PROXY to provide one server for both

More details on our proxy handling:

- https://github.com/Rob--W/proxy-from-env#environment-variables
- https://github.com/TooTallNate/node-proxy-agent

This is the natural way of things for Linux. My understanding is that
most proxies on MacOS are system-wide and transparent, so it's not so
urgent. But Windows will likely require further UI for configuration.
Will need to do some testing with Windows users.
2017-12-04 15:35:50 -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
16ad94148a
Introduce library for notifications on downlevel windows (#1812) 2017-11-22 13:50:52 -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
1c455c83e0
Set parent window for about/new version, escape to close (#1795)
* Set parent window for about/new version, escape to close

* Exclude jquery from jshint run
2017-11-21 15:23:18 -08:00
Scott Nonnenberg
9e6d50b966
Merge branch 'master' into development
Bringing our development (beta) branch inline with all the more urgent
fixes which went directly into the master (production) branch.
2017-11-08 17:02:00 -08:00
Scott Nonnenberg
d953a61d39
preload.js: Load spellcheck last; it fails with /tmp noexec (#1734) 2017-11-08 15:52:42 -08:00
Lilia
1f967abf0a Update libphonenumber (#1598)
* Update libphonenumber

Also switch from bower to yarn for managing this dependency.

// FREEBIE

* Remove libphonenumber from bower.json

// FREEBIE
2017-10-30 14:45:57 -07: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
Lilia
af8b0164b5 Move to node fetch API for web requests instead of XHR (#1552)
* Use node-fetch instead of xhr

* Remove XMLHttpRequest.js

// FREEBIE

* Avoid calling json() on non json responses

Previously we would catch and swallow JSON parsing errors resulting from an
empty response, though empty responses are normal from a few endpoints, like
requesting sms or voice registration codes.

Since the JSON parsing call is now handled internally by node-fetch, we have to
keep closer track of our expected response type to avoid throwing an exception.

// FREEBIE
2017-10-20 15:52:02 -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
b64f2969fd Better handling of network disconnection/reconnection (#1546)
* Ensure that our preload.js setImmediate call finds right function

FREEBIE

* Our own socket close event, better logging, unregistration

FREEBIE

* Return CLOSED for NetworkStatusView if we've fully disconnected

* background.js: Remove messageReceiver = null, log in connect()

A null messageReciever makes the NetworkStatusView think we're online.

FREEBIE
2017-10-06 16:28:13 -07:00
Scott Nonnenberg
2d650bd627 Further workaround to try to push node.js event loop forward (#1511)
FREEBIE
2017-09-28 14:47:49 -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
4449a5f110 Upgrade emoji support (#1482)
* Upgrade emoji deps and move to node_modules

Add support for Emoji 3.0 and switch from bower to yarn for managing emoji
dependencies.

// FREEBIE

* Delete old emoji deps

// FREEBIE

* Don't copy emoji on windows

It is no longer necessary since the symlinked image dir is gone.

// FREEBIE

* Update emoji test

// FREEBIE

* Fix emoji tests; remove all overrides of emoji-js functions

FREEBIE
2017-09-15 13:22:11 -07:00
Lilia
50c470e53d
Certificate pinning via node XMLHttpRequest implementation (#1394)
* Add certificate pinning on https service requests

Make https requests to the server using node apis instead of browser apis, so we
can specify our own CA list, which contains only our own CA.

This protects us from MITM by a rogue CA.

As a bonus, this let's us drop the use of non-standard ports and just use good
ol' default 443 all the time, at least for http requests.

// FREEBIE

* Make certificateAuthorities an option on requests

Modify node-based xhr implementation based on driverdan/node-XMLHttpRequest,
adding support for setting certificate authorities on each request.

This allows us to pin our master CA for requests to the server and cdn but not
to the s3 attachment server, for instance. Also fix an exception when sending
binary data in a request: it is submitted as an array buffer, and must be
converted to a node Buffer since we are now using a node based request api.

// FREEBIE

* Import node-based xhr implementation

Add a copy of https://github.com/driverdan/node-XMLHttpRequest@86ff70e, and
expose it to the renderer in the preload script.

In later commits this module will be extended to support custom certificate
authorities.

// FREEBIE

* Support "arraybuffer" responseType on requests

When fetching attachments, we want the result as binary data rather than a utf8
string. This lets our node-based XMLHttpRequest honor the responseType property
if it is set on the xhr.

Note that naively using the raw `.buffer` from a node Buffer won't work, since
it is a reuseable backing buffer that is often much larger than the actual
content defined by the Buffer's offset and length.

Instead, we'll prepare a return buffer based on the response's content length
header, and incrementally write chunks of data into it as they arrive.

// FREEBIE

* Switch to self-signed server endpoint

* Log more error info on failed requests

With the node-based xhr, relevant error info are stored in statusText and
responseText when a request fails.

// FREEBIE

* Add node-based websocket w/ support for custom CA

// FREEBIE

* Support handling array buffers instead of blobs

Our node-based websocket calls onmessage with an arraybuffer instead of a blob.
For robustness (on the off chance we switch or update the socket implementation
agian) I've kept the machinery for converting blobs to array buffers.

// FREEBIE

* Destroy all wacky server ports

// FREEBIE
2017-09-14 17:03:17 -07:00
Scott Nonnenberg
e8c7e31363
Multi-error, multi-language, and cross-platform spell-check
FREEBIE
2017-09-14 17:03:17 -07:00
Scott Nonnenberg
ba347744ff
Import: choice on first startup, workflow, ported to Node.js fs API
FREEBIE
2017-09-14 17:02:43 -07:00
lilia
04e40043d2
Add View -> Debug Log to menu bar
Just send an event from the main process to the renderer,
The latter routes it the appropriate view method.

For now it's a no-op unless the main window exists and it is showing the inbox,
which will be addressed in a future commit.

// FREEBIE
2017-09-14 16:53:52 -07:00
lilia
33a82cc8e8
Add spellcheck smoke test
Exposes the spellcheck provider as window.spellChecker, which allows it to be
called from tests.
2017-09-14 16:53:48 -07:00
Scott Nonnenberg
3a3aa3efb6
Remove test/protos symlink, use window.PROTO_ROOT for config 2017-09-14 16:53:48 -07:00
Scott Nonnenberg
4402a91976
Use correct locale, fall back to en if we don't have translations
FREEBIE
2017-09-14 16:53:47 -07:00
lilia
ab8edd8690
Add spectron tests to grunt:test-release
// FREEBIE
2017-09-14 16:53:45 -07:00
lilia
7c6da5a157
Make 'Restart Signal' actually restart Signal
Previously it would just reload the page.

// FREEBIE
2017-09-14 16:53:45 -07:00
lilia
b5649a6874
Add ability to unhide the window from the renderer
via ipc, for instance if a notification is clicked but the window is
closed/hidden.

// FREEBIE
2017-09-14 16:53:43 -07:00
lilia
0c9cca08ba
Draw attention to the window on new messages
// FREEBIE
2017-09-14 16:53:41 -07:00
lilia
ea930d53ae
Set badge count
This is displayed on the launcher icon on linux/mac

// FREEBIE
2017-09-14 16:53:41 -07:00
lilia
77d5ef2f68
Add spellcheck
As of Electron 1.6.5, this requires disabling the sandbox in order to
get access to the `webFrame` api.

// FREEBIE
2017-09-14 16:53:39 -07:00
lilia
4d11e257fe
Use built-in url parsing in preload script
Latest electron allows acces to the url module in a preload script.
Also add a wrapper to shield global scope and use strict inside.

// FREEBIE
2017-09-14 16:53:39 -07:00
lilia
c83dbc1bf0
Rename window.env to window.config
Also normalize to camelCase for configs.

// FREEBIE
2017-09-14 16:53:38 -07:00
lilia
550b926a15
Log on preload 2017-09-14 16:53:36 -07:00
lilia
63657db3be
Quick fix for i18n
Just use the english locale for now. Load locale data from the
filesystem in the main process and pass it to the renderer preload
script via ipc. Note that we need the locale data to be available by the
time view scripts are loaded.

// FREEBIE
2017-09-14 16:53:35 -07:00
lilia
2bbd0d58c6
Separate development and production environments
Set NODE_ENV at run time or build time to switch the app between dev and
production modes.

At build time, the current NODE_ENV will be included in the packaged
app's package.json file. At runtime we read NODE_ENV from package.json,
but also allow the local environment variable to override. A query
string parsed by a preload script exposes the value to the renderer,
which then determines whether we use the staging or production server.
Additionally, different environments have different user data
directories.

// FREEBIE
2017-09-14 16:53:35 -07:00