Repair broken attachments with non-array 'data' fields

This commit is contained in:
Scott Nonnenberg 2022-07-18 13:01:43 -07:00 committed by GitHub
parent a0424be5bb
commit 2f252b8e26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 105 additions and 34 deletions

View file

@ -9,7 +9,22 @@ import type {
QuotedMessageType,
} from '../model-types.d';
import type { UUIDStringType } from '../types/UUID';
import { isIncoming, isOutgoing, isStory } from '../state/selectors/message';
export function isIncoming(
message: Pick<MessageAttributesType, 'type'>
): boolean {
return message.type === 'incoming';
}
export function isOutgoing(
message: Pick<MessageAttributesType, 'type'>
): boolean {
return message.type === 'outgoing';
}
export function isStory(message: Pick<MessageAttributesType, 'type'>): boolean {
return message.type === 'story';
}
export function isQuoteAMatch(
message: MessageAttributesType | null | undefined,