refactor: Removed duplicate callNotificationType check in Message getDescription()

This commit is contained in:
Will G 2022-06-29 17:34:52 +10:00 committed by GitHub
parent ed092e6612
commit 09dec1246a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1295,21 +1295,6 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
return window.i18n('answeredACall', [displayName]);
}
}
if (this.get('callNotificationType')) {
const displayName = getConversationController().getContactProfileNameOrShortenedPubKey(
this.get('conversationId')
);
const callNotificationType = this.get('callNotificationType');
if (callNotificationType === 'missed-call') {
return window.i18n('callMissed', [displayName]);
}
if (callNotificationType === 'started-call') {
return window.i18n('startedACall', [displayName]);
}
if (callNotificationType === 'answered-a-call') {
return window.i18n('answeredACall', [displayName]);
}
}
return this.get('body');
}
}