fix: strip of tags notification/lastmessage

pull/3206/head
Audric Ackermann 9 months ago
parent 6e55cd6893
commit 07b9b37abb

@ -265,7 +265,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
return description; return description;
} }
if ((this.get('attachments') || []).length > 0) { if ((this.get('attachments') || []).length > 0) {
return window.i18n('contentDescriptionMediaMessage'); return window.i18n.stripped('contentDescriptionMediaMessage');
} }
if (this.isExpirationTimerUpdate()) { if (this.isExpirationTimerUpdate()) {
const expireTimerUpdate = this.getExpirationTimerUpdate(); const expireTimerUpdate = this.getExpirationTimerUpdate();
@ -285,20 +285,20 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
const authorName = const authorName =
getConversationController() getConversationController()
.get(source || '') .get(source || '')
?.getNicknameOrRealUsernameOrPlaceholder() || window.i18n('unknown'); ?.getNicknameOrRealUsernameOrPlaceholder() || window.i18n.stripped('unknown');
if (!expireTimerUpdate || expirationMode === 'off' || !expireTimer || expireTimer === 0) { if (!expireTimerUpdate || expirationMode === 'off' || !expireTimer || expireTimer === 0) {
return window.i18n('disappearingMessagesTurnedOff', { return window.i18n.stripped('disappearingMessagesTurnedOff', {
name: authorName, name: authorName,
}); });
} }
const localizedMode = const localizedMode =
expirationMode === 'deleteAfterRead' expirationMode === 'deleteAfterRead'
? window.i18n('disappearingMessagesTypeRead') ? window.i18n.stripped('disappearingMessagesTypeRead')
: window.i18n('disappearingMessagesTypeSent'); : window.i18n.stripped('disappearingMessagesTypeSent');
return window.i18n('disappearingMessagesSet', { return window.i18n.stripped('disappearingMessagesSet', {
time: TimerOptions.getAbbreviated(expireTimerUpdate.expireTimer || 0), time: TimerOptions.getAbbreviated(expireTimerUpdate.expireTimer || 0),
name: authorName, name: authorName,
disappearing_messages_type: localizedMode, disappearing_messages_type: localizedMode,
@ -1278,7 +1278,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
} }
if (groupUpdate.name) { if (groupUpdate.name) {
return window.i18n('groupNameNew', { group_name: groupUpdate.name }); return window.i18n.stripped('groupNameNew', { group_name: groupUpdate.name });
} }
if (groupUpdate.joined?.length) { if (groupUpdate.joined?.length) {
@ -1294,11 +1294,11 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
} }
window.log.warn('did not build a specific change for getDescription of ', groupUpdate); window.log.warn('did not build a specific change for getDescription of ', groupUpdate);
return window.i18n('groupUpdated'); return window.i18n.stripped('groupUpdated');
} }
if (this.isGroupInvitation()) { if (this.isGroupInvitation()) {
return `😎 ${window.i18n('communityInvitation')}`; return `😎 ${window.i18n.stripped('communityInvitation')}`;
} }
if (this.isDataExtractionNotification()) { if (this.isDataExtractionNotification()) {
@ -1306,14 +1306,14 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
'dataExtractionNotification' 'dataExtractionNotification'
) as DataExtractionNotificationMsg; ) as DataExtractionNotificationMsg;
if (dataExtraction.type === SignalService.DataExtractionNotification.Type.SCREENSHOT) { if (dataExtraction.type === SignalService.DataExtractionNotification.Type.SCREENSHOT) {
return window.i18n('screenshotTaken', { return window.i18n.stripped('screenshotTaken', {
name: getConversationController().getContactProfileNameOrShortenedPubKey( name: getConversationController().getContactProfileNameOrShortenedPubKey(
dataExtraction.source dataExtraction.source
), ),
}); });
} }
return window.i18n('attachmentsMediaSaved', { return window.i18n.stripped('attachmentsMediaSaved', {
name: getConversationController().getContactProfileNameOrShortenedPubKey( name: getConversationController().getContactProfileNameOrShortenedPubKey(
dataExtraction.source dataExtraction.source
), ),
@ -1325,13 +1325,13 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
); );
const callNotificationType = this.get('callNotificationType'); const callNotificationType = this.get('callNotificationType');
if (callNotificationType === 'missed-call') { if (callNotificationType === 'missed-call') {
return window.i18n('callsMissedCallFrom', { name }); return window.i18n.stripped('callsMissedCallFrom', { name });
} }
if (callNotificationType === 'started-call') { if (callNotificationType === 'started-call') {
return window.i18n('callsYouCalled', { name }); return window.i18n.stripped('callsYouCalled', { name });
} }
if (callNotificationType === 'answered-a-call') { if (callNotificationType === 'answered-a-call') {
return window.i18n('callsInProgress'); return window.i18n.stripped('callsInProgress');
} }
} }
@ -1353,11 +1353,11 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
return ''; return '';
case ConversationInteractionType.Leave: case ConversationInteractionType.Leave:
return isCommunity return isCommunity
? window.i18n('communityLeaveError', { ? window.i18n.stripped('communityLeaveError', {
community_name: convo.getNicknameOrRealUsernameOrPlaceholder(), community_name: convo.getNicknameOrRealUsernameOrPlaceholder(),
}) })
: isGroup : isGroup
? window.i18n('groupLeaveErrorFailed', { ? window.i18n.stripped('groupLeaveErrorFailed', {
group_name: convo.getNicknameOrRealUsernameOrPlaceholder(), group_name: convo.getNicknameOrRealUsernameOrPlaceholder(),
}) })
: ''; : '';
@ -1374,7 +1374,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
if (this.get('reaction')) { if (this.get('reaction')) {
const reaction = this.get('reaction'); const reaction = this.get('reaction');
if (reaction && reaction.emoji && reaction.emoji !== '') { if (reaction && reaction.emoji && reaction.emoji !== '') {
return window.i18n('emojiReactsNotification', { emoji: reaction.emoji }); return window.i18n.stripped('emojiReactsNotification', { emoji: reaction.emoji });
} }
} }
return this.get('body'); return this.get('body');

Loading…
Cancel
Save