Commit Graph

65 Commits

Author SHA1 Message Date
Fedor Indutny 4ef0bf96cc
Uint8Array migration 2021-09-23 17:49:05 -07:00
Fedor Indutny dbd427396c
Convert js/modules/types/contact.js to TypeScript 2021-09-23 09:26:25 -05:00
Evan Hahn 9e9a815a2b
ESLint: allow `for..of` 2021-08-26 13:18:00 -05:00
Fedor Indutny e534dd64f2
Don't transcode incoming attachments 2021-07-20 12:31:23 -07:00
Fedor Indutny c3bdf3d411
Show lightbox for GIFs 2021-07-14 16:39:52 -07:00
Josh Perez 01eabf9ec6
Option to send photos as high quality 2021-06-25 11:08:16 -05:00
Evan Hahn 8bfaf598af Add license headers across the project 2020-11-04 13:03:13 -06:00
Evan Hahn bdd71e4898 Support APNGs in Sticker Creator 2020-10-12 18:10:07 -04:00
Chris Svenningsen 8a2c17f65f Apply new ESLint rules to legacy code 2020-09-09 17:34:57 -07:00
Ken Powers 29de50c12a Stickers
Co-authored-by: scott@signal.org
Co-authored-by: ken@signal.org
2019-05-16 16:10:37 -07:00
Scott Nonnenberg 1d2c3ae23c Download attachments in separate queue from message processing 2019-02-12 16:34:21 -08:00
Scott Nonnenberg 92c071e083 Use the proper method for pulling attachments off disk for retry 2019-01-29 16:08:03 -08:00
Scott Nonnenberg 813924685e Link Previews 2019-01-29 13:53:14 -08:00
Scott Nonnenberg e4babdaef0 Updates to backup infrastructure 2019-01-04 12:21:26 -08:00
Scott Nonnenberg ca61c9cb85 Warnings for dangerous files 2018-10-09 13:48:32 -07:00
Scott Nonnenberg fedfbed304 Copy quoted message contents into quote on receipt
Also:
  - visually distinguish any reference we couldn't verify on receipt
  - show toast on quote click if we can't scroll to message
  - toast visuals redesigned to match rest of app
2018-08-15 14:58:55 -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 02675312c5 Introduce mandatary migration on startup, to minimum version 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 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 aa13a2c6f7 Parse phone numbers into e164 as part of schema upgrade 2018-05-10 11:54:58 -07:00
Daniel Gasienica 3bf8a8966a Notification improvements
- Remove on read, on focus, and on exit.
- Show multi-message notifications like '5 new messages'.
2018-05-10 14:45:56 -04: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
Daniel Gasienica 101041f106 Derive `Message.CURRENT_SCHEMA_VERSION` 2018-05-08 16:41:06 -04:00
Scott Nonnenberg 26be658892 Remove 'Contact' from 'Contact.*' properties, clean->parse 2018-05-08 13:12:11 -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 3ea3e4e256 Contact sharing: protos and data pipeline
As of this commit: 82b76ccf37
2018-05-07 19:09:55 -07:00
Daniel Gasienica 6eca5ee940 Document that JPEG auto-orient strips EXIF metadata 2018-04-30 19:05:10 -04:00
Daniel Gasienica 1dd87ad197 Format all source code using Prettier 2018-04-30 16:53:34 -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 8e3c38d5fe Fix formatting 2018-04-25 15:25:12 -04:00
Daniel Gasienica 146178f977 Update schema documentation 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 d14761087a Add schema version 4: Attachment metadata 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 a7d44d3344
Backup and end-to-end test! 2018-04-20 15:24:04 -07:00
Scott Nonnenberg f1ff040842
Finish type definition for _mapQuotedAttachments 2018-04-16 12:16:34 -07:00
Scott Nonnenberg 9ad55c803f
Fix handling attachment thumbnails using thumbnail key 2018-04-13 18:10:51 -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
Daniel Gasienica 24f4ad53bc Use single quotes for identifiers 2018-04-11 15:54:32 -04:00
Daniel Gasienica 195e9b777c Rename `willHaveAttachmentsSavedOnFileSystemDuringUpgrade`
New name: `willAttachmentsGoToFileSystemOnUpgrade`
2018-04-04 19:11:46 -04:00
Daniel Gasienica 4c4443390a Rename `createImporter` to `createAttachmentDataWriter` 2018-04-04 19:11:46 -04:00
Daniel Gasienica 5ea1a305a6 Clarify error origin 2018-04-04 18:41:50 -04:00
Daniel Gasienica 9dcb64b53c Initialize schema version upon import 2018-04-04 18:41:50 -04:00
Daniel Gasienica 94c75762b5 Add `Message.createAttachmentLoader` 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