Merge pull request #19724 from ramonlsouza/issue-19168
fix: user away message on chat export
This commit is contained in:
commit
cedddf8e2c
@ -23,6 +23,7 @@ query getChatMessageHistory {
|
||||
messageId
|
||||
messageType
|
||||
messageMetadata
|
||||
senderName
|
||||
chatEmphasizedText
|
||||
createdAt
|
||||
user {
|
||||
|
@ -13,6 +13,14 @@ const intlMessages = defineMessages({
|
||||
id: 'app.chat.pollResult',
|
||||
description: 'used in place of user name who published poll to chat',
|
||||
},
|
||||
userAway: {
|
||||
id: 'app.chat.away',
|
||||
description: 'message when user is away',
|
||||
},
|
||||
userNotAway: {
|
||||
id: 'app.chat.notAway',
|
||||
description: 'message when user is no longer away',
|
||||
},
|
||||
});
|
||||
|
||||
export const htmlDecode = (input: string) => {
|
||||
@ -50,6 +58,14 @@ export const generateExportedMessages = (
|
||||
messageText = pollText.slice(0, -1);
|
||||
break;
|
||||
}
|
||||
case ChatMessageType.USER_AWAY_STATUS_MSG: {
|
||||
const { away } = JSON.parse(message.messageMetadata);
|
||||
|
||||
messageText = (away)
|
||||
? `${message.senderName} ${intl.formatMessage(intlMessages.userAway)}`
|
||||
: `${message.senderName} ${intl.formatMessage(intlMessages.userNotAway)}`;
|
||||
break;
|
||||
}
|
||||
case ChatMessageType.TEXT:
|
||||
default:
|
||||
messageText = htmlDecode(message.message);
|
||||
|
Loading…
Reference in New Issue
Block a user