-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New 'unseenStatus' field for certain secondary message types
- Loading branch information
1 parent
ed9f54d
commit 3a1df01
Showing
23 changed files
with
610 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.