consider that a reply to our message is a mention for notification

pull/1804/head
Audric Ackermann 4 years ago
parent d14807d2ab
commit dbd6563fa0
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1412,8 +1412,16 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
const text = message.get('body'); const text = message.get('body');
const mentions = text?.match(regex) || ([] as Array<string>); const mentions = text?.match(regex) || ([] as Array<string>);
const mentionMe = mentions && mentions.some(m => UserUtils.isUsFromCache(m.slice(1))); const mentionMe = mentions && mentions.some(m => UserUtils.isUsFromCache(m.slice(1)));
if (!mentionMe) {
window?.log?.info('notifications disabled for non mentions for convo', conversationId); const quotedMessageAuthor = message.get('quote')?.author;
const isReplyToOurMessage =
quotedMessageAuthor && UserUtils.isUsFromCache(quotedMessageAuthor);
if (!mentionMe && !isReplyToOurMessage) {
window?.log?.info(
'notifications disabled for non mentions or reply for convo',
conversationId
);
return; return;
} }

@ -19,7 +19,6 @@ import { OpenGroupMessageV2 } from './OpenGroupMessageV2';
import { handleOpenGroupV2Message } from '../../receiver/receiver'; import { handleOpenGroupV2Message } from '../../receiver/receiver';
import autoBind from 'auto-bind'; import autoBind from 'auto-bind';
import { sha256 } from '../../session/crypto'; import { sha256 } from '../../session/crypto';
import { fromBase64ToArrayBuffer } from '../../session/utils/String';
import { DURATION } from '../../session/constants'; import { DURATION } from '../../session/constants';
const pollForEverythingInterval = DURATION.SECONDS * 10; const pollForEverythingInterval = DURATION.SECONDS * 10;

Loading…
Cancel
Save