Commit Graph

630 Commits (7d7133a38c97d69def7a201940fafc0f6943f883)

Author SHA1 Message Date
Scott Nonnenberg 8cb1f1f532 Fall back on givenName/familyName if no displayName/organization 7 years ago
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.
7 years ago
Daniel Gasienica 63bd9dcc61 Add tests for `Attachment.isVisualMedia` 7 years ago
Daniel Gasienica 53918d68de Add `Attachment.isFile` definition 7 years ago
Daniel Gasienica 15759f0db5 Normalize package naming 7 years ago
Daniel Gasienica 5789b3eb75 Add `Attachment.isVoiceMessage` 7 years ago
Daniel Gasienica fa4c3fda2b Extract common MIME types 7 years ago
Daniel Gasienica 5d230d3778 Add `Settings.isNotificationGroupingSupported`
See: https://github.com/electron/electron/issues/11189
7 years ago
Daniel Gasienica ecf23b6b2e Disable audio notifications on Windows 7 and lower 7 years ago
Daniel Gasienica a102016ed8 Port `Settings` and `OS` to TypeScript 7 years ago
Daniel Gasienica 87d374ea78 Remove `@prettier` pragmas 7 years ago
Daniel Gasienica 1dd87ad197 Format all source code using Prettier 7 years ago
Daniel Gasienica b74b761255 Implement click to save for document list 7 years ago
Daniel Gasienica 4a5e61eaf4 Implement `Attachment.save` 7 years ago
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.
7 years ago
Daniel Gasienica fca8de16c8 Add required `Message.id: string` 7 years ago
Daniel Gasienica 8b9516de72 Update test for attachment metadata 7 years ago
Daniel Gasienica 45d89d1e44 Create `UserMessage` type
Describes user visible messages that can have attachments.
7 years ago
Daniel Gasienica 648a7ab1bb Autoformat using Prettier 7 years ago
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 */]
```
7 years ago
Daniel Gasienica b0fefdbb98 Implementing grouping messages by date 7 years ago
Daniel Gasienica 424965f876 🎨 Autoformat code 7 years ago
Daniel Gasienica 3d70e46aea Calculate dates in UTC 7 years ago
Daniel Gasienica e34347f290 Add `groupMessagesByDate` 7 years ago
Daniel Gasienica 94ef3bab80 Move test file 7 years ago
Daniel Gasienica 44debd123d Add basic implementation of `Conversation.updateFromLastMessage` 7 years ago
Daniel Gasienica 55fc21505e Rename `ts/test` to `ts/styleguide` 7 years ago
Scott Nonnenberg 96bd90a4e0
Simplify assignment; add warning to preload.js about Style Guide 7 years ago
Scott Nonnenberg 05303233fb
window.Signal.React -> window.Signal.Components 7 years ago
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.
7 years ago