Compare commits

...

2 Commits

Author SHA1 Message Date
Gleidson Daniel Silva 85d80de84a
Merge branch 'develop' into fix.lastmessage-attachment 2023-02-14 14:27:16 -03:00
Reinaldo Neto 5fcfb8ea45 [FIX] Respect Use Real Name when sent an attachment 2023-02-08 15:49:23 -03:00
1 changed files with 10 additions and 2 deletions

View File

@ -24,8 +24,16 @@ const formatMsg = ({ lastMessage, type, showLastMessage, username, useRealName }
const isLastMessageSentByMe = lastMessage.u.username === username; const isLastMessageSentByMe = lastMessage.u.username === username;
if (!lastMessage.msg && lastMessage.attachments && Object.keys(lastMessage.attachments).length) { if (!lastMessage.msg && lastMessage.attachments && Object.keys(lastMessage.attachments).length) {
const user = isLastMessageSentByMe ? I18n.t('You') : lastMessage.u.username; const userAttachment = () => {
return I18n.t('User_sent_an_attachment', { user }); if (isLastMessageSentByMe) {
return I18n.t('You');
}
if (useRealName && lastMessage.u.name) {
return lastMessage.u.name;
}
return lastMessage.u.username;
};
return I18n.t('User_sent_an_attachment', { user: userAttachment() });
} }
// Encrypted message pending decrypt // Encrypted message pending decrypt