New 'unseenStatus' field for certain secondary message types
This commit is contained in:
parent
ed9f54d7d6
commit
3a1df01c9e
23 changed files with 610 additions and 143 deletions
25
ts/MessageSeenStatus.ts
Normal file
25
ts/MessageSeenStatus.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/**
|
||||
* `SeenStatus` represents either the idea that a message doesn't need to track its seen
|
||||
* status, or the standard unseen/seen status pair.
|
||||
*
|
||||
* Unseen is a lot like unread - except that unseen messages only affect the placement
|
||||
* of the last seen indicator and the count it shows. Unread messages will affect the
|
||||
* left pane badging for conversations, as well as the overall badge count on the app.
|
||||
*/
|
||||
export enum SeenStatus {
|
||||
NotApplicable = 0,
|
||||
Unseen = 1,
|
||||
Seen = 2,
|
||||
}
|
||||
|
||||
const STATUS_NUMBERS: Record<SeenStatus, number> = {
|
||||
[SeenStatus.NotApplicable]: 0,
|
||||
[SeenStatus.Unseen]: 1,
|
||||
[SeenStatus.Seen]: 2,
|
||||
};
|
||||
|
||||
export const maxSeenStatus = (a: SeenStatus, b: SeenStatus): SeenStatus =>
|
||||
STATUS_NUMBERS[a] > STATUS_NUMBERS[b] ? a : b;
|
Loading…
Add table
Add a link
Reference in a new issue