Commit graph

596 commits

Author SHA1 Message Date
sachaaaaa
468a92f861 Fix electron tests 2019-07-31 10:23:10 +10:00
Mikunj
2c12c8a1d8 Convert profile field in data message to use LokiProfile instead of signal Contact. 2019-05-29 09:26:16 +10:00
Mikunj
fbbf454c49 Merge branch 'development' into signal-1.24 2019-04-29 16:24:34 +10:00
Beaudan Campbell-Brown
318371a652
Merge pull request #264 from BeaudanBrown/remove-signal-references
Remove Signal references
2019-04-29 08:39:44 +10:00
Mikunj
b8ef6c2cc6 Loki changes
Added friends section in search.

This is because contacts is now used in signal for something else and we don't want to clash meanings.

Styling fixes

Add dropdown options into mainheader

Updated styling

Restore StartNewConversation to the old ui style of loki messenger.

Fix friend search display.

Fix header expand animation.

Hooked up menu actions.

Linting.

More styling changes.

Fix tests.

Added back in the loki logo below the gutter.

Fix toast positioning.

Fix context menu showing incorrectly on virtual lists.

Added tabs.

Linting
2019-04-24 13:25:20 +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
12ce0140de Left pane changes.
Merge commit 'b3ac1373fa64117fe2a9ccfddf3712f1826c06d9' into signal-1.23

# Conflicts:
#	_locales/en/messages.json
#	background.html
#	js/background.js
#	js/conversation_controller.js
#	js/models/conversations.js
#	js/models/messages.js
#	js/views/conversation_list_item_view.js
#	js/views/conversation_list_view.js
#	js/views/conversation_search_view.js
#	js/views/inbox_view.js
#	libtextsecure/account_manager.js
#	package.json
#	stylesheets/_global.scss
#	stylesheets/_index.scss
#	stylesheets/_modules.scss
#	test/_test.js
#	test/index.html
#	test/models/conversations_test.js
#	test/views/conversation_search_view_test.js
#	ts/components/ConversationListItem.tsx
#	ts/components/MainHeader.tsx
#	ts/components/conversation/ConversationHeader.tsx
#	ts/components/conversation/ResetSessionNotification.tsx
2019-04-17 16:42:09 +10:00
Mikunj
48c4ed1a29 Partial Merge commit 'bf904ddd129ceba8fa363ccf6d10ecd256c65f63' into signal-1.23
# Conflicts:
#	_locales/en/messages.json
#	app/sql.js
#	js/background.js
#	js/conversation_controller.js
#	js/models/conversations.js
#	js/views/inbox_view.js
#	main.js
2019-04-17 13:47:17 +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
Beaudan
7eabae18f5 Replaced more references to signal with loki and updated CONTRIBUTING.md 2019-04-11 16:56:24 +10:00
Jonathan Canfield
97b26778b3 Remap zoom to Command+= on macOS (#3296) 2019-04-08 10:17:35 -07:00
Scott Nonnenberg
74cb808763 New MessageController as the single place for in-memory messages 2019-04-04 17:17:19 -07:00
Scott Nonnenberg
8c4d90df07 Send long text as an attachment instead of inline
Remove Android length warning

Handle incoming long message attachments

Show long download pending status in message bubble

Fix the width of the smallest spinner

Remove Android length warning from HTML templates
2019-03-14 17:30:46 -07:00
Scott Nonnenberg
b3ac1373fa Move left pane entirely to React 2019-03-12 17:44:14 -07:00
Scott Nonnenberg
ae161c6cf6 Update to Electron 4.x 2019-03-12 17:44:14 -07:00
Scott Nonnenberg
ae2db9f09a Improve handling for URLs composed of mixed character sets 2019-03-12 17:44:14 -07:00
sachaaaaa
b39b45e29d Fix #214 Replace help menu links 2019-03-01 14:44:16 +11:00
Scott Nonnenberg
5b54c9554e Remove groups table, conversation is single source of truth 2019-02-13 16:04:58 -08:00
Scott Nonnenberg
041fe4be05 Remove JSON column and Backbone Model for unprocessed 2019-02-13 16:04:58 -08:00
Scott Nonnenberg
9c540ab977 Add cache support to Signal Protocol Store 2019-02-13 16:04:58 -08:00
Scott Nonnenberg
1d2c3ae23c Download attachments in separate queue from message processing 2019-02-12 16:34:21 -08:00
Scott Nonnenberg
858c7e629f Fine-tune linkification technique for link previews 2019-02-11 18:32:05 -08: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
02d6920ade Tests for loki_p2p_api, added yarn command to generate coverage html, instantiating loki_p2p_api in the test preload 2019-02-06 10:26:25 +11:00
Mikunj
926362f88a Rename queue_manager to job_queue 2019-02-05 10:45:46 +11:00
Mikunj
594a815069 Fix test 2019-02-01 13:37:15 +11:00
Beaudan
9ff96a0250 Fixed tests and moved friend request status enum to new friends file 2019-01-31 10:26:46 +11:00
Scott Nonnenberg
813924685e Link Previews 2019-01-29 13:53:14 -08: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
f92e8485f8 Merge development into lint
Added gitattributes
2019-01-17 09:42:12 +11:00
Beaudan Campbell-Brown
ea1d007b4f
Merge pull request #136 from Mikunj/tests
Tests
2019-01-16 17:07:38 +11:00
Mikunj
6bd2d3962e Linted files 2019-01-16 16:18:08 +11:00
Mikunj
b4248afd98 Updated a profile test. 2019-01-16 15:29:08 +11:00
Mikunj
cd3d17f977 Fix review issues. 2019-01-16 13:05:54 +11:00
Mikunj
6467b0bb45 Fix up tests. 2019-01-16 12:38:29 +11:00
Mikunj
1f10a73e4f Updated strings. 2019-01-16 11:30:09 +11:00
Mikunj
feb8af476a Refactored BlockedNumberController. 2019-01-16 10:34:34 +11:00
Mikunj
7aad9417c7 Added blocked number controller tests 2019-01-15 14:00:34 +11:00
Mikunj
faeb319c58 Added profile model test. 2019-01-15 12:45:53 +11:00
Scott Nonnenberg
e4babdaef0 Updates to backup infrastructure 2019-01-04 12:21:26 -08:00
Scott Nonnenberg
47f834cf5c Encrypt device name on account create, on first launch if needed 2019-01-04 12:21:26 -08:00
Mikunj
654b0dac84 Merge signal-master. 2018-12-17 12:56:04 +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
0491ceacf1 Added seed dialog.
Fixed issue where incorrect language was used to generate seed.
2018-12-12 11:27:41 +11:00
sachaaaaa
bce44c4ec2 remove secretsessioncipher test 2018-12-11 16:16:19 +11:00
sachaaaaa
a1255dd31e
Merge pull request #77 from Mikunj/password-protection
Password protection
2018-12-10 16:28:10 +11:00
Mikunj
e1aba93aea Merge signal 1.18.1 changes. 2018-12-10 15:04:12 +11:00
Beaudan
7782c58d14 Slight refactor of PoW file to make easier to test plus some tests for the PoW functionality 2018-12-10 14:13:54 +11:00
Mikunj
9e995bde6c Review fixes.
Updated tests.
2018-12-10 11:19:20 +11:00
Mikunj
0b87f13699 Added password dialog view. 2018-12-07 15:34:16 +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
08ebc63fb0 Added simple tests. 2018-12-06 15:39:17 +11:00
Beaudan
13db2d666f Fixed test again after rebase, reworked some logic in the conversation validateNumber function to correctly reflect what libsignal thinks is valid 2018-12-05 15:19:24 +11:00
Beaudan
eb7a0dbb3a Fix failing tests except for problematic spellcheck package 2018-12-05 15:19:24 +11:00
Beaudan
d8a410cc69 Linting of the test flies 2018-12-05 15:19:24 +11:00
Mikunj
14ecbc3f35 Moved MainHeader into its own Backbone View. 2018-12-04 08:47:09 +11:00
Mikunj
62135a1810 Added a section below conversation list.
Fixed scrolling on conversations.
2018-11-29 16:02:02 +11:00
sachaaaaa
3bf52c8f82
Update test/index.html
Co-Authored-By: Mikunj <Mikunj@users.noreply.github.com>
2018-11-29 15:45:07 +11:00
Scott Nonnenberg
313d08344a Request configuration sync on startup of new version 2018-11-28 12:35:26 -08:00
Mikunj
ac4e04912c Minor language fixes. 2018-11-28 10:44:44 +11:00
Mikunj
6ce9d6a08c Added nickname dialog. 2018-11-28 10:31:11 +11:00
Scott Nonnenberg
70eed938d9 Store arrayBuffers in database for remote identity keys 2018-11-26 16:22:49 -08:00
Scott Nonnenberg
11fdf22881 Change sessions.id to a TEXT field to prevent type coercion 2018-11-26 15:22:55 -08:00
Scott Nonnenberg
bde1462159 Change sessions.id to a TEXT field to prevent type coercion 2018-11-26 15:10:23 -08:00
Mikunj
8cc9b7b54b Added blocked number model and collection.
Added blocked number controller.
Hooked up BlockedNumberController loading.
2018-11-16 15:31:00 +11:00
Mikunj
0a88f337d5 Merge branch 'sig-development' into merge/signal 2018-11-12 10:06:34 +11:00
Scott Nonnenberg
e828253ef0 Restor full function syntax to custom Mocha reporter 2018-11-07 16:53:41 -08:00
Scott Nonnenberg
dbf0be2db5 eslintify all test files 2018-11-07 16:34:38 -08:00
Scott Nonnenberg
884bc9333d Make timestamp test a bit more forgiving 2018-11-07 16:34:20 -08:00
Mikunj
1a4adf2281 Merge branch 'development' into merge/signal 2018-11-08 07:23:27 +11:00
Mikunj
f589fdac5c Merge signal changes into branch. 2018-11-07 15:26:37 +11:00
Mikunj
4e6df71999 Fix up tests. 2018-11-07 12:15:22 +11:00
Scott Nonnenberg
0297279084 Eliminate some conversation fields which are no longer used 2018-11-01 17:00:24 -07:00
Scott Nonnenberg
1755e0adfd Move all remaining stores to SQLCipher 2018-10-31 17:36:51 -07:00
Scott Nonnenberg
a7d78c0e9b Sealed Sender support
https://signal.org/blog/sealed-sender/
2018-10-29 14:49:18 -07:00
Scott Nonnenberg
ca61c9cb85 Warnings for dangerous files 2018-10-09 13:48:32 -07:00
Scott Nonnenberg
cd60bdd08a Move conversations to SQLCipher 2018-10-01 18:18:37 -07:00
Scott Nonnenberg
7983300f4a Use base64 strings for incoming message cache instead of binary 2018-08-10 13:13:25 -07:00
Scott Nonnenberg
3105b77475 Migrate to SQLCipher for messages/cache
Quite a few other fixes, including:
  - Sending to contact with no avatar yet (not synced from mobile)
  - Left pane doesn't update quickly or at all on new message
  - Left pane doesn't show sent or error status

Also:
 - Contributing.md: Ensure set of linux dev dependencies is complete
2018-07-31 17:08:45 -07:00
Scott Nonnenberg
61f7b8360b Conversation: store lastMessage/lastMessageStatus in memory only 2018-07-27 10:55:10 -07:00
Scott Nonnenberg
f39a96bc76 Move to centralized message/cache data layer
Also, ensure that conversation.messageCollection has nothing in it
unless it has an associated ConversationView.
2018-07-27 10:55:10 -07:00
Scott Nonnenberg
34231168a7 On message delete, ensure that all external files are deleted 2018-07-27 09:15:57 -07: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
b159a8d7c7 Update the user agent for debug log requests 2018-07-18 20:00:10 -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
43a44793c5 Remove jshint - move everything over to eslint
Also removed all hints of previous linters
2018-07-17 15:54:32 -07:00
Scott Nonnenberg
fc5c52fbdf Remove iOS theme in favor of plain light/dark themes 2018-07-17 15:45:40 -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
4415293100 Make all OS menus localizable
Turns out that Electron is not localizing the 'role' elements like we
expected would happen.
2018-07-03 16:04:21 -07:00
Scott Nonnenberg
8eeaad8e18 Remove unused export/import functionality 2018-06-21 11:54:01 -07:00
Scott Nonnenberg
068cce61e6 Fix path-oriented unit test on Windows 2018-05-31 14:09:41 -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
eec61f5289 Fine-tune file protocol filter 2018-05-31 13:25:45 -07:00
Scott Nonnenberg
06b0544bbe Hardening: normalize on-disk attachment paths before save/load 2018-05-31 13:25:45 -07:00
Scott Nonnenberg
cfe0bd0e79 Move to npm for several dependencies
mustache
jQuery
underscore
backbone
mocha
chai
intl-tel-input
2018-05-23 16:26:48 -07:00
Scott Nonnenberg
01be58acc2 Remove formatting in importError localization string 2018-05-23 16:26:48 -07:00
Scott Nonnenberg
548c8e69cf Emojification now all done with react via a few new components
Three locations were changed:
  1. a group update, which lists a set of contacts
  2. the contact name in the left pane
  3. the conversation title

Three new components were added to window.Signal.Components to support
these scenarios, respectively:
  1. Emojify
  2. ContactName
  3. ConversationTitle

Note that there are a number of other places in the app that should be
emojified, but never have been before. Essentially any place that a
contact name might be shown. A non-exhaustive list:
  - Show group members
  - Show safety number
  - Verified change notification
  - Disappearing timer change notification
  - Contact verification notification
  - Quote contact name
2018-05-23 16:26:47 -07:00
Scott Nonnenberg
a5416e42c4 Refactor all emoji utility methods into window.Signal.Emoji 2018-05-23 16:26:47 -07:00
Scott Nonnenberg
e2d044e02b Filter file scheme; disable http, https and ftp entirely 2018-05-23 16:26:40 -07:00
Scott Nonnenberg
4e5c8965ff Move to react for newlines, emoji, and links in message body 2018-05-14 16:09:37 -07:00
Scott Nonnenberg
aa13a2c6f7 Parse phone numbers into e164 as part of schema upgrade 2018-05-10 11:54:58 -07:00
Daniel Gasienica
16bc1d34c6 Message schema 6: Change classification of media and documents
For an easier implementation, we change our original definition of
`initializeAttachmentMetadata`. This means we have to re-run it marked as
version 6 and mark schema version 5 as deprecated as its definition has changed.
2018-05-08 16:41:07 -04:00
Scott Nonnenberg
26be658892 Remove 'Contact' from 'Contact.*' properties, clean->parse 2018-05-08 13:12:11 -07:00
Scott Nonnenberg
adbe989949 validateContact: Return error instead of logging 2018-05-08 10:31:16 -07:00
Scott Nonnenberg
420f81ebcd Move contact migrate code from message.js to contact.js 2018-05-08 09:48:47 -07:00
Scott Nonnenberg
41be7f126b Visuals for embedded contacts as well as contact detail screen 2018-05-07 19:09:55 -07:00
Scott Nonnenberg
3ea3e4e256 Contact sharing: protos and data pipeline
As of this commit: 82b76ccf37
2018-05-07 19:09:55 -07:00
Daniel Gasienica
5c8f734e67 Remove newlines from group IDs 2018-05-03 13:24:39 -04:00
Daniel Gasienica
a102016ed8 Port Settings and OS to TypeScript 2018-05-02 20:01:57 -04:00
Daniel Gasienica
95321e5d3e Remove Vim mode lines 2018-04-30 16:53:34 -04:00
Daniel Gasienica
1dd87ad197 Format all source code using Prettier 2018-04-30 16:53:34 -04:00
Daniel Gasienica
41fe50553f Replace Backbone saveFile with Attachment.save 2018-04-27 16:31:42 -04:00
Daniel Gasienica
9a76d4bcf8 Whitelist assert global for tests 2018-04-27 16:31:42 -04:00
Daniel Gasienica
19411a78c8 Remove dead code 2018-04-25 15:25:12 -04:00
Daniel Gasienica
52e4e5aece Omit undefined keys when comparing IndexedDB data 2018-04-25 15:25:12 -04:00
Daniel Gasienica
f36f206a01 Use IndexablePresence for hasFileAttachments and hasVisualMediaAttachments
Reduces index size, makes it easier to debug using IndexedDB inspector, and
hopefully improves lookup performance.
2018-04-25 15:25:12 -04:00
Daniel Gasienica
3a33d862c0 Update backup test fixture 2018-04-25 15:25:12 -04:00
Daniel Gasienica
8b9516de72 Update test for attachment metadata 2018-04-25 15:24:52 -04:00
Daniel Gasienica
b0e1cc49a5 Remove legacy Backbone lightbox 2018-04-25 15:24:51 -04:00
Daniel Gasienica
9d84b2f420 Index messages with attachments using a boolean
When indexing message attachment metadata using numeric indexes such as:

```javascript
{
  conversationId: '+12223334455',
  received_at: 123,
  attachments: […],
  numAttachments: 2,
},
{
  conversationId: '+12223334455',
  received_at: 456,
  attachments: [],
  numAttachments: 0,
}
{
  conversationId: '+12223334455',
  received_at: 789,
  attachments: [],
  numAttachments: 1,
}
```

It creates an index as follows:

```
[conversationId, received_at, numAttachments]
['+12223334455', 123, 2]
['+12223334455', 456, 0]
['+12223334455', 789, 1]
```

This means a query such as…

```
lowerBound: ['+12223334455', 0,                1               ]
upperBound: ['+12223334455', Number.MAX_VALUE, Number.MAX_VALUE]
```

…will return all three original entries because they span the `received_at`
from `0` through `Number.MAX_VALUE`. One workaround is to index booleans using
`1 | undefined` where `1` is included in the index and `undefined` is not, but
that way we lose the ability to query for the `false` value. Instead, we flip
adjust the index to `[conversationId, hasAttachments, received_at]` and can
then query messages with attachments using

```
[conversationId, 1 /* hasAttachments */, 0                /* received_at */]
[conversationId, 1 /* hasAttachments */, Number.MAX_VALUE /* received_at */]
```
2018-04-25 15:24:51 -04:00
Daniel Gasienica
f9e4613395 Move TS test for message migration 2018-04-25 15:24:50 -04:00
Daniel Gasienica
867bece952 Add Message.initializeAttachmentMetadata 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
bf81c3db63
Document Message v4, remove data-free thumbnails 2018-04-23 16:43:25 -07: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
6ec6bf08c8
Backup E2E test: Normalize paths because glob returns / on WIN 2018-04-20 17:29:55 -07:00
Scott Nonnenberg
1bfc1ed63e
Backup E2E test: Fix path analysis on windows 2018-04-20 16:56:39 -07:00
Scott Nonnenberg
a7d44d3344
Backup and end-to-end test! 2018-04-20 15:24:04 -07:00
Scott Nonnenberg
c3acf43c47
Eslintify test/backup_test.js 2018-04-20 15:24:04 -07:00
Scott Nonnenberg
3abaeb807d
Prevent infinite repeated errors on leaving electron tests open 2018-04-20 15:24:03 -07:00
Scott Nonnenberg
334fe32210
Fix electron test race condition with protobuf loading 2018-04-20 15:24:02 -07:00
Scott Nonnenberg
12257e1560
MessageView: Show menu w/ 'reply to message' on triple-dot click 2018-04-20 15:23:55 -07:00
Scott Nonnenberg
26e4e97592
Tighten up CSS
- Remove extra padding at top of Android bubbles, via sibling selector
- Don't include .attachments, .quote-wrapper, .content in bubble unless
  we actually need them. This allows for sibling selectors.
- This is a different technique for adding the ReactWrapperView for
  quotes - it is now appended to the DOM instead of attaching to
  something already in the DOM. This allows us to use .remove(), so it's
  a bit cleaner.
- Users of ReactWrapperView can now specify tagName and className
2018-04-20 15:23:47 -07:00
Scott Nonnenberg
30957341e4
Show three dot icon next to message on hover
But only if it doesn't have an error.

Also: reformatted message template in legacy_templates.js to match what
is in background.html for easier diffing.
2018-04-20 15:23:47 -07:00
Scott Nonnenberg
a563dc8b37
Style Guide: Additional message examples, a few fixes to enable 2018-04-20 15:23:47 -07:00
Scott Nonnenberg
3bbbf65a6b
Fix iOS: tail, blue partial border, extra attachment space
Turns out that display: inline on the img tag resulted in a mysterious
3px of space added below it.
2018-04-13 18:10:52 -07:00
Scott Nonnenberg
9ad55c803f
Fix handling attachment thumbnails using thumbnail key 2018-04-13 18:10:51 -07:00
Scott Nonnenberg
fce9bb7342
Move to central MIME functions, remove some console.log
And generally address PR feedback.
2018-04-13 18:10:51 -07:00
Scott Nonnenberg
92a89a8e41
Fix MessageView test: p -> div 2018-04-13 18:10:48 -07:00
Scott Nonnenberg
2243e348f1
Wire up fake window.Signal.HTML because it's captured on load 2018-04-13 18:10:48 -07:00
Scott Nonnenberg
054d3887a1
Quotes: The full pipeline into the database
1. MessageReceiver always pulls down thumbnails included in quotes
2. Message.upgradeSchema has a new schema that puts all thumbnails on
   disk just like happens with full attachments.
3. handleDataMessage pipes quote from dataMessage into the final message
   destined for the database
2018-04-13 18:05:45 -07:00
Scott Nonnenberg
e69586200a
Unleash eslint on message_receiver.js - lots of change 2018-04-13 18:05:45 -07:00
Scott Nonnenberg
21bf02c94d
Fixed examples in Quote.md, rough Android visuals 2018-04-13 18:05:44 -07:00
Scott Nonnenberg
ae043bf239
In iOS theme, join attachment bubble with caption bubble 2018-04-13 18:05:42 -07:00
Scott Nonnenberg
3a76c3c86e
Styleguide: Incoming/outgoing attachments of all types 2018-04-13 18:05:42 -07:00
Daniel Gasienica
ad05efb7a0 Expose Signal.Types.Conversation 2018-04-11 19:34:21 -04:00
Daniel Gasienica
96c07c6373 Bump timeout of debuglogs test 2018-04-11 16:36:42 -04:00
Daniel Gasienica
15d221ae0e Simplify testing and linting
Separate linting from testing as follows:

- `yarn jscs`: Run JSCS.
- `yarn jshint`: Run JSHint.
- `yarn lint`: Run all linters, i.e. ESLint, TSLint, JSHint, and JSHint.

- `yarn test-node`: Run Mocha tests in Node.js environment.
- `yarn test-electron`: Run tests in Electron environment via Grunt.
- `yarn test`: Run all tests.

CI
- Align Travis and AppVeyor scripts as much as possible.
- Run linting before tests to fail fast.
- Run Node.js (headless and fast) tests first.
- Run Electron tests last (Travis seems to require custom setup in `travis.sh`).
2018-04-11 16:36:42 -04:00
Daniel Gasienica
24f4ad53bc Use single quotes for identifiers 2018-04-11 15:54:32 -04:00
Daniel Gasienica
432a6ebd7f Redact file paths with escaped slashes 2018-04-11 15:30:59 -04:00
Daniel Gasienica
d41e3cd6fc Add test for regular _redactPath 2018-04-11 15:30:59 -04:00
Daniel Gasienica
a8a7525609 Redact stack traces with forward and backslashes 2018-04-11 15:30:59 -04:00
Daniel Gasienica
b0da7d965e Redact URL encoded file paths in stack traces 2018-04-11 15:30:59 -04:00
Daniel Gasienica
2ee78ec556 Prefer path over Path 2018-04-11 15:30:59 -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
05303233fb
window.Signal.React -> window.Signal.Components 2018-04-05 16:10:59 -07:00
Scott Nonnenberg
23537546fe
Big refactor: ts/ directory for all typescript, including react
Split out test-specific and general utility react components too.

And moved our test/legacy* files for the Style Guide into a styleguide/
subdirectory of test/.

I think we'll be able to live in this directory structure for a while.
2018-04-05 15:30:40 -07:00
Scott Nonnenberg
887abd75dd
Add missing shim, fix typo 2018-04-05 08:31:19 -07:00
Scott Nonnenberg
104a1ca5d4
Remove i18n.js from jshint run, fix missing semicolon 2018-04-04 17:26:57 -07:00
Daniel Gasienica
4c4443390a Rename createImporter to createAttachmentDataWriter 2018-04-04 19:11:46 -04:00
Scott Nonnenberg
1326b26585
Full styleguide now available via yarn styleguide
Due to a number of hacks, the style guide can be used to show Backbone
views. This will allow a smooth path from the old way of doing things to
the new.
2018-04-04 16:08:38 -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
Daniel Gasienica
bf67254cc5 Add Message.createImporter 2018-04-04 18:41:50 -04:00
Daniel Gasienica
5a6668e677 Add Attachments.createWriteForExisting
This function lets us choose where to write attachment to instead of picking
random name.
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
colefranz
234411cb29 issue-2023: introduce unit tests for inbox view
There were no unit tests for the file at all so I added some simple ones
mostly focused on my changes.
2018-04-04 15:42:13 -04:00
Daniel Gasienica
8474f3cf7f Use create* prefix to clarify curried functions 2018-04-03 15:25:24 -04:00
Daniel Gasienica
9c7afab21b Clear database before message view tests 2018-04-03 11:45:11 -04:00
Daniel Gasienica
9065b647ad Run migrations before clearing database during tests 2018-04-03 11:45:11 -04:00
Daniel Gasienica
01480f5dd2 Improve formatting 2018-04-03 11:45:11 -04:00
Daniel Gasienica
d6ea158e46 Avoid dangerouslyCreateAndAdd in MessageView test 2018-03-27 19:52:18 -04:00
Daniel Gasienica
83c979fb84 Rename createTemporary to dangerouslyCreateAndAdd
Class: `ConversationController`.

This function should not be used in application code as it creates potentially
invalid `Conversation` instances in our global conversation collection. We keep
making it available for testing purposes.
2018-03-27 19:52:17 -04:00
Daniel Gasienica
867f73b80a Use double quotes for identifiers in error messages 2018-03-26 16:38:34 -04:00
Daniel Gasienica
06e7bca276 Use new stringToArrayBuffer function 2018-03-26 16:38:34 -04:00
Daniel Gasienica
10afcf1bb0 Add Attachments.deleteData 2018-03-26 16:38:34 -04:00
Daniel Gasienica
9b636a1885 Add test for Attachments.readData 2018-03-26 16:38:34 -04:00
Daniel Gasienica
f6f0359a61 Use assert.deepEqual instead of Lodash isEqual 2018-03-26 16:38:34 -04:00
Daniel Gasienica
aba261122f 🎨 Use camelCase for mutable variable 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
6355c54114 Return relative path from writeAttachmentData
This will make our app more robust to changes in location on the file system.
2018-03-26 16:38:34 -04:00
Daniel Gasienica
1262d1d696 Shorten prefix to 2 characters
Using 2 hex characters [0-9a-f] will give us 16 * 16 = 256 root folders which
seems more manageable than 4096 (16^3). Assuming a user has 10,000 attachments,
they should roughly distribute at ~40 per folder with prefix length 2 rather
than ~2.5 per folder with a prefix of 3.
2018-03-26 16:38:34 -04:00
Daniel Gasienica
2cd3d5ac16 Add Message schema version 3 2018-03-26 16:38:34 -04:00
Daniel Gasienica
ebe2a769c9 Add Attachment.migrateDataToFileSystem 2018-03-26 16:38:34 -04:00
Daniel Gasienica
1283c77518 Switch from hashed to random attachment file names
Using hashes, we get the benefit of deduplication but if a user receives two
messages with the same attachment, deleting one would delete it for both since
they are only stored once. To avoid the complexity of tracking number of
references, we simply generate random file names similar to iMessage on MacOS
(?) and Signal Android.
2018-03-26 16:38:34 -04:00
Daniel Gasienica
d9de6dacba Add writeAttachmentData module 2018-03-26 16:38:34 -04:00
Vincent
5b5903c70e Fix link to Signal update location
Fixes #2043.
2018-03-23 12:15:52 -07: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
6d8f4b7b6e
Backup: zipped messages.json, flat attachments dir
Backup creates, in a target directory:
  - An attachments folder, with all attachments, each named for their
    parent message's id - a GUID. If there is more than one attachment
    in a given message,  each attachment beyond the first will end with
    '-N', zero-indexed.
  - A file named messages.zip. It contains exactly what went to disk in
    the original export code, but zipped up.

Export is now only 'light,' and in this new messages.zip format.

Import supports both the new format and the old format. If the target
directory has a messages.zip file, we'll treat it as the new format.

Next up: Encrypting attachments and the messages.zip!
2018-03-20 11:53:22 -07:00
Scott Nonnenberg
e583434366
Refactor: Move Backup under window.Signal 2018-03-20 11:53:19 -07:00
Daniel Gasienica
8dfaa5619f Prefix private functions with underscore 2018-03-19 19:27:59 -04:00
Daniel Gasienica
ed336d31d7 Move schema versioning from Attachment to Message 2018-03-19 19:27:59 -04:00
Daniel Gasienica
b9e9f5e19a 🎨 withInheritedSchemaVersion to inheritSchemaVersion 2018-03-19 19:27:59 -04:00
Daniel Gasienica
c27746b79e Add Message.withInheritedSchemaVersion 2018-03-19 19:27:59 -04:00
Daniel Gasienica
e9e46464c2 Add SchemaVersion type 2018-03-19 19:27:59 -04:00
Daniel Gasienica
add4b11df3 Skip invalid attachments and make function sync 2018-03-19 19:27:59 -04:00