Show "unplayed" dot on incoming audio messages
This commit is contained in:
parent
9fd191ae00
commit
b0750e5f4e
36 changed files with 812 additions and 175 deletions
17
ts/messages/migrateLegacyReadStatus.ts
Normal file
17
ts/messages/migrateLegacyReadStatus.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { MessageAttributesType } from '../model-types.d';
|
||||
import { ReadStatus } from './MessageReadStatus';
|
||||
|
||||
export function migrateLegacyReadStatus(
|
||||
message: Readonly<Pick<MessageAttributesType, 'readStatus'>>
|
||||
): undefined | ReadStatus {
|
||||
const shouldMigrate = message.readStatus == null;
|
||||
if (!shouldMigrate) {
|
||||
return;
|
||||
}
|
||||
|
||||
const legacyUnread = (message as Record<string, unknown>).unread;
|
||||
return legacyUnread ? ReadStatus.Unread : ReadStatus.Read;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue