Remove refs to MessageModel in conversations.ts

This commit is contained in:
Fedor Indutny 2024-07-25 16:29:49 -07:00 committed by GitHub
parent 2550af9c91
commit cc6ff0b554
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 312 additions and 357 deletions

View file

@ -2,7 +2,10 @@
// SPDX-License-Identifier: AGPL-3.0-only
import type { AciString } from '../types/ServiceId';
import type { MessageAttributesType } from '../model-types.d';
import type {
MessageAttributesType,
ReadonlyMessageAttributesType,
} from '../model-types.d';
import type { MessageModel } from '../models/messages';
import type { ReactionSource } from '../reactions/ReactionSource';
import { DataReader } from '../sql/Client';
@ -41,11 +44,11 @@ function remove(reaction: ReactionAttributesType): void {
}
export function findReactionsForMessage(
message: MessageModel
message: ReadonlyMessageAttributesType
): Array<ReactionAttributesType> {
const matchingReactions = Array.from(reactions.values()).filter(reaction => {
return isMessageAMatchForReaction({
message: message.attributes,
message,
targetTimestamp: reaction.targetTimestamp,
targetAuthorAci: reaction.targetAuthorAci,
reactionSenderConversationId: reaction.fromId,
@ -99,7 +102,7 @@ function isMessageAMatchForReaction({
targetAuthorAci,
reactionSenderConversationId,
}: {
message: MessageAttributesType;
message: ReadonlyMessageAttributesType;
targetTimestamp: number;
targetAuthorAci: string;
reactionSenderConversationId: string;