- - {caption} - -
-- {unsafeSenderName} + {includeSenderNameMessages.includes(message.system_message_type) && ( + {unsafeSenderName} + )} {caption}
diff --git a/src/script/components/MessagesList/MessageList.tsx b/src/script/components/MessagesList/MessageList.tsx index 472ed7248e3..dbfcc5d85cd 100644 --- a/src/script/components/MessagesList/MessageList.tsx +++ b/src/script/components/MessagesList/MessageList.tsx @@ -101,7 +101,7 @@ const filterDuplicatedSystemMessages = (messages: MessageEntity[]) => { } if (currentMessage.isSystem()) { - const systemMessagesToFilter = [CONVERSATION_EVENT.RENAME] as string[]; + const systemMessagesToFilter = [CONVERSATION_EVENT.RENAME, CONVERSATION_EVENT.PROTOCOL_UPDATE] as string[]; if (systemMessagesToFilter.includes(currentMessage.type)) { const uniqUpdateMessages = uniqMessages.filter( (message): message is SystemMessage => message.isSystem() && systemMessagesToFilter.includes(message.type), diff --git a/src/script/entity/message/Message.ts b/src/script/entity/message/Message.ts index 41d4f7e8293..77aba96d19d 100644 --- a/src/script/entity/message/Message.ts +++ b/src/script/entity/message/Message.ts @@ -40,7 +40,6 @@ import type {LinkPreview} from './LinkPreview'; import type {MemberMessage} from './MemberMessage'; import {MissedMessage} from './MissedMessage'; import type {PingMessage} from './PingMessage'; -import {ProtocolUpdateMessage} from './ProtocolUpdateMessage'; import type {SystemMessage} from './SystemMessage'; import type {VerificationMessage} from './VerificationMessage'; @@ -317,10 +316,6 @@ export class Message { return this.super_type === SuperType.MISSED; } - isProtocolUpdate(): this is ProtocolUpdateMessage { - return this.super_type === SuperType.PROTOCOL_UPDATE; - } - isCallTimeout(): this is CallingTimeoutMessage { return this.super_type === SuperType.CALL_TIME_OUT; } diff --git a/src/script/entity/message/ProtocolUpdateMessage.ts b/src/script/entity/message/ProtocolUpdateMessage.ts index 900cbacc6a7..b4ec861b90f 100644 --- a/src/script/entity/message/ProtocolUpdateMessage.ts +++ b/src/script/entity/message/ProtocolUpdateMessage.ts @@ -18,10 +18,9 @@ */ import {ConversationProtocol} from '@wireapp/api-client/lib/conversation'; -import {CONVERSATION_EVENT} from '@wireapp/api-client/lib/event/'; import ko from 'knockout'; -import {SuperType} from 'src/script/message/SuperType'; +import {SystemMessageType} from 'src/script/message/SystemMessageType'; import {t} from 'Util/LocalizerUtil'; import {SystemMessage} from './SystemMessage'; @@ -29,8 +28,7 @@ import {SystemMessage} from './SystemMessage'; export class ProtocolUpdateMessage extends SystemMessage { constructor(public protocol: ConversationProtocol.MIXED | ConversationProtocol.MLS) { super(); - this.type = CONVERSATION_EVENT.PROTOCOL_UPDATE; - this.super_type = SuperType.PROTOCOL_UPDATE; + this.system_message_type = SystemMessageType.CONVERSATION_PROTOCOL_UPDATE; this.caption = ko.pureComputed(() => this.protocol === ConversationProtocol.MIXED ? t('conversationProtocolUpdatedToMixed') diff --git a/src/script/message/SuperType.ts b/src/script/message/SuperType.ts index 3970b4ea82a..fe1f11584b0 100644 --- a/src/script/message/SuperType.ts +++ b/src/script/message/SuperType.ts @@ -30,7 +30,6 @@ export enum SuperType { LOCATION = 'location', MEMBER = 'member', MISSED = 'missed', - PROTOCOL_UPDATE = 'protocol-update', PING = 'ping', REACTION = 'reaction', SPECIAL = 'special', diff --git a/src/script/message/SystemMessageType.ts b/src/script/message/SystemMessageType.ts index adea6201ce9..d436aa55baa 100644 --- a/src/script/message/SystemMessageType.ts +++ b/src/script/message/SystemMessageType.ts @@ -29,6 +29,7 @@ export enum SystemMessageType { CONVERSATION_MESSAGE_TIMER_UPDATE = 'message-timer-update', CONVERSATION_RECEIPT_MODE_UPDATE = 'receipt-mode-update', CONVERSATION_RENAME = 'rename', + CONVERSATION_PROTOCOL_UPDATE = 'protocol-update', CONVERSATION_RESUME = 'resume', MEMBER_JOIN = 'join', MEMBER_LEAVE = 'leave',