Introduce Service Id Types

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Fedor Indutny 2023-08-10 18:43:33 +02:00 committed by Jamie Kyle
parent 414c0a58d3
commit 366b875fd2
269 changed files with 5832 additions and 5550 deletions

View file

@ -2,20 +2,12 @@
// SPDX-License-Identifier: AGPL-3.0-only
import type { ConversationModel } from '../models/conversations';
import type { UUID } from '../types/UUID';
import type { MessageModel } from '../models/messages';
import * as log from '../logging/log';
import dataInterface from '../sql/Client';
import { isGroup } from './whatTypeOfConversation';
import { isMessageUnread } from './isMessageUnread';
function isSameUuid(
a: UUID | string | null | undefined,
b: UUID | string | null | undefined
): boolean {
return a != null && b != null && String(a) === String(b);
}
export async function shouldReplyNotifyUser(
message: MessageModel,
conversation: ConversationModel
@ -49,10 +41,10 @@ export async function shouldReplyNotifyUser(
return false;
}
const currentUserId = window.textsecure.storage.user.getUuid();
const storySourceId = matchedStory.sourceUuid;
const ourAci = window.textsecure.storage.user.getAci();
const storySourceAci = matchedStory.sourceUuid;
const currentUserIdSource = isSameUuid(storySourceId, currentUserId);
const currentUserIdSource = storySourceAci === ourAci;
// If the story is from the current user, always notify
if (currentUserIdSource) {