Treat replies similarly to mentions for notifications

Co-authored-by: trevor-signal <131492920+trevor-signal@users.noreply.github.com>
This commit is contained in:
automated-signal
2026-02-23 12:06:56 -06:00
committed by GitHub
parent d83eac4fcd
commit f1394afee5
3 changed files with 20 additions and 9 deletions

View File

@@ -613,7 +613,7 @@ export function CallManager({
activeProfile: activeNotificationProfile,
conversationId: ringingCallId,
isCall: true,
isMention: false,
isMentionOrReply: false,
})
) {
const redactedId = redactNotificationProfileId(
@@ -727,7 +727,7 @@ export function CallManager({
if (
!shouldNotify({
isCall: true,
isMention: false,
isMentionOrReply: false,
conversationId: ringingCall.conversation.id,
activeProfile: activeNotificationProfile,
})

View File

@@ -23,6 +23,7 @@ import {
} from '../messageModifiers/Polls.preload.js';
import { shouldStoryReplyNotifyUser } from '../util/shouldStoryReplyNotifyUser.preload.js';
import { ReactionSource } from '../reactions/ReactionSource.std.js';
import { itemStorage } from '../textsecure/Storage.preload.js';
const log = createLogger('maybeNotify');
@@ -44,11 +45,21 @@ type MaybeNotifyArgs = {
}
);
function isMention(args: MaybeNotifyArgs): boolean {
function isMentionOrReply(args: MaybeNotifyArgs): boolean {
if ('reaction' in args || 'pollVote' in args) {
return false;
}
return Boolean(args.message.mentionsMe);
if (args.message.mentionsMe) {
return true;
}
const quoteAuthorAci = args.message.quote?.authorAci;
if (quoteAuthorAci && itemStorage.user.isOurServiceId(quoteAuthorAci)) {
return true;
}
return false;
}
export async function maybeNotify(args: MaybeNotifyArgs): Promise<void> {
@@ -95,7 +106,7 @@ export async function maybeNotify(args: MaybeNotifyArgs): Promise<void> {
activeProfile,
conversationId: conversation.id,
isCall: false,
isMention: isMention(args),
isMentionOrReply: isMentionOrReply(args),
})
) {
log.info('Would notify for message, but notification profile prevented it');
@@ -220,5 +231,5 @@ function isAllowedByConversation(args: MaybeNotifyArgs): boolean {
return false;
}
return isMention(args);
return isMentionOrReply(args);
}

View File

@@ -97,12 +97,12 @@ export const NOTIFICATION_PROFILE_ID_LENGTH = 16;
export function shouldNotify({
isCall,
isMention,
isMentionOrReply,
conversationId,
activeProfile,
}: {
isCall: boolean;
isMention: boolean;
isMentionOrReply: boolean;
conversationId: string;
activeProfile: NotificationProfileType | undefined;
}): boolean {
@@ -114,7 +114,7 @@ export function shouldNotify({
return true;
}
if (isMention && activeProfile.allowAllMentions) {
if (isMentionOrReply && activeProfile.allowAllMentions) {
return true;
}