[FIX] Joining and leaving messages in teams (#3591)

Co-authored-by: Gleidson Daniel Silva <gleidson10daniel@hotmail.com>
Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Danish Ahmed Mirza 2022-01-17 20:01:15 +05:30 committed by GitHub
parent 9d9553b075
commit 11af3503b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View File

@ -26,7 +26,9 @@ export const SYSTEM_MESSAGES = [
'au',
'ru',
'ul',
'ult',
'uj',
'ujt',
'ut',
'rm',
'user-muted',
@ -50,8 +52,10 @@ export const SYSTEM_MESSAGE_TYPES = {
MESSAGE_PINNED: 'message_pinned',
MESSAGE_SNIPPETED: 'message_snippeted',
USER_JOINED_CHANNEL: 'uj',
USER_JOINED_TEAM: 'ujt',
USER_JOINED_DISCUSSION: 'ut',
USER_LEFT_CHANNEL: 'ul'
USER_LEFT_CHANNEL: 'ul',
USER_LEFT_TEAM: 'ult'
};
export const SYSTEM_MESSAGE_TYPES_WITH_AUTHOR_NAME = [
@ -59,8 +63,10 @@ export const SYSTEM_MESSAGE_TYPES_WITH_AUTHOR_NAME = [
SYSTEM_MESSAGE_TYPES.MESSAGE_PINNED,
SYSTEM_MESSAGE_TYPES.MESSAGE_SNIPPETED,
SYSTEM_MESSAGE_TYPES.USER_JOINED_CHANNEL,
SYSTEM_MESSAGE_TYPES.USER_JOINED_TEAM,
SYSTEM_MESSAGE_TYPES.USER_JOINED_DISCUSSION,
SYSTEM_MESSAGE_TYPES.USER_LEFT_CHANNEL
SYSTEM_MESSAGE_TYPES.USER_LEFT_CHANNEL,
SYSTEM_MESSAGE_TYPES.USER_LEFT_TEAM
];
type TInfoMessage = {
@ -77,6 +83,9 @@ export const getInfoMessage = ({ type, role, msg, author }: TInfoMessage) => {
if (type === 'uj') {
return I18n.t('Has_joined_the_channel');
}
if (type === 'ujt') {
return I18n.t('Has_joined_the_team');
}
if (type === 'ut') {
return I18n.t('Has_joined_the_conversation');
}
@ -92,6 +101,9 @@ export const getInfoMessage = ({ type, role, msg, author }: TInfoMessage) => {
if (type === 'ul') {
return I18n.t('Has_left_the_channel');
}
if (type === 'ult') {
return I18n.t('Has_left_the_team');
}
if (type === 'ru') {
return I18n.t('User_removed_by', { userRemoved: msg, userBy: username });
}

View File

@ -249,8 +249,10 @@
"Full_table": "Click to see full table",
"Generate_New_Link": "Generate New Link",
"Has_joined_the_channel": "has joined the channel",
"Has_joined_the_team": "has joined the team",
"Has_joined_the_conversation": "has joined the conversation",
"Has_left_the_channel": "has left the channel",
"Has_left_the_team": "has left the team",
"Hide_System_Messages": "Hide System Messages",
"Hide_type_messages": "Hide \"{{type}}\" messages",
"How_It_Works": "How It Works",

View File

@ -3,10 +3,18 @@ export const MessageTypeValues = [
value: 'uj',
text: 'Message_HideType_uj'
},
{
value: 'ujt',
text: 'Message_HideType_ujt'
},
{
value: 'ul',
text: 'Message_HideType_ul'
},
{
value: 'ult',
text: 'Message_HideType_ult'
},
{
value: 'ru',
text: 'Message_HideType_ru'