Hide message contents in notifications for message requests
This commit is contained in:
parent
822b162136
commit
3a069323a4
4 changed files with 42 additions and 5 deletions
|
@ -185,6 +185,7 @@ import * as Edits from '../messageModifiers/Edits';
|
|||
import { handleEditMessage } from '../util/handleEditMessage';
|
||||
import { getQuoteBodyText } from '../util/getQuoteBodyText';
|
||||
import { shouldReplyNotifyUser } from '../util/shouldReplyNotifyUser';
|
||||
import { isConversationAccepted } from '../util/isConversationAccepted';
|
||||
import type { RawBodyRange } from '../types/BodyRange';
|
||||
import { BodyRange, applyRangesForText } from '../types/BodyRange';
|
||||
|
||||
|
@ -831,6 +832,17 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
|
|||
const { text, emoji } = this.getNotificationData();
|
||||
const { attributes } = this;
|
||||
|
||||
const conversation = this.getConversation();
|
||||
|
||||
strictAssert(
|
||||
conversation != null,
|
||||
'Conversation not found in ConversationController'
|
||||
);
|
||||
|
||||
if (!isConversationAccepted(conversation.attributes)) {
|
||||
return window.i18n('icu:message--getNotificationText--messageRequest');
|
||||
}
|
||||
|
||||
if (attributes.storyReaction) {
|
||||
if (attributes.type === 'outgoing') {
|
||||
const name = this.getConversation()?.get('profileName');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue