fix: show last message when pinned (#5316)

* fix: show last message when pinned

* add the Pinned_a_message and the message as a quote

* tweak at locales
This commit is contained in:
Reinaldo Neto 2023-11-14 15:42:31 -03:00 committed by GitHub
parent b205b54e3b
commit 1d681917b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 12 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,7 @@ const formatMsg = ({ lastMessage, type, showLastMessage, username, useRealName }
if (!showLastMessage) { if (!showLastMessage) {
return ''; return '';
} }
if (!lastMessage || !lastMessage.u || lastMessage.pinned) { if (!lastMessage || !lastMessage.u) {
return I18n.t('No_Message'); return I18n.t('No_Message');
} }
if (lastMessage.t === 'jitsi_call_started') { if (lastMessage.t === 'jitsi_call_started') {

View File

@ -91,6 +91,11 @@ const Message = React.memo((props: IMessage) => {
<MessageAvatar small {...props} /> <MessageAvatar small {...props} />
<View style={[styles.messageContent, props.isHeader && styles.messageContentWithHeader]}> <View style={[styles.messageContent, props.isHeader && styles.messageContentWithHeader]}>
<Content {...props} /> <Content {...props} />
{props.isInfo && props.type === 'message_pinned' ? (
<View pointerEvents='none'>
<Attachments {...props} />
</View>
) : null}
</View> </View>
</View> </View>
</View> </View>

View File

@ -158,7 +158,7 @@ export const getInfoMessage = ({ type, role, msg, author, comment }: TInfoMessag
case 'subscription-role-removed': case 'subscription-role-removed':
return I18n.t('Removed_user_as_role', { user: msg, role }); return I18n.t('Removed_user_as_role', { user: msg, role });
case 'message_pinned': case 'message_pinned':
return I18n.t('Message_pinned'); return I18n.t('Pinned_a_message');
// without author name // without author name
case 'ul': case 'ul':

View File

@ -204,7 +204,6 @@
"Members": "أفراد", "Members": "أفراد",
"Mentions": "الإشارات", "Mentions": "الإشارات",
"Message_actions": "إجراءات الرسالة", "Message_actions": "إجراءات الرسالة",
"Message_pinned": "الرسالة مثبتة",
"Message_removed": "الرسالة حذفت", "Message_removed": "الرسالة حذفت",
"Message_starred": "الرسالة مميزة", "Message_starred": "الرسالة مميزة",
"Message_unstarred": "الرسالة غير مميزة", "Message_unstarred": "الرسالة غير مميزة",

View File

@ -223,7 +223,6 @@
"Members": "Mitglieder", "Members": "Mitglieder",
"Mentions": "Erwähnungen", "Mentions": "Erwähnungen",
"Message_actions": "Nachrichtenaktionen", "Message_actions": "Nachrichtenaktionen",
"Message_pinned": "Eine Nachricht wurde angeheftet",
"Message_removed": "Nachricht entfernt", "Message_removed": "Nachricht entfernt",
"Message_starred": "Nachricht favorisiert", "Message_starred": "Nachricht favorisiert",
"Message_unstarred": "Nachricht nicht mehr favorisiert", "Message_unstarred": "Nachricht nicht mehr favorisiert",

View File

@ -223,7 +223,6 @@
"Members": "Members", "Members": "Members",
"Mentions": "Mentions", "Mentions": "Mentions",
"Message_actions": "Message actions", "Message_actions": "Message actions",
"Message_pinned": "Message pinned",
"Message_removed": "message removed", "Message_removed": "message removed",
"Message_starred": "Message starred", "Message_starred": "Message starred",
"Message_unstarred": "Message unstarred", "Message_unstarred": "Message unstarred",
@ -754,5 +753,6 @@
"The_room_does_not_exist": "The room does not exist or you may not have access permission", "The_room_does_not_exist": "The room does not exist or you may not have access permission",
"Supported_versions_expired_title": "{{workspace_name}} is running an unsupported version of Rocket.Chat", "Supported_versions_expired_title": "{{workspace_name}} is running an unsupported version of Rocket.Chat",
"Supported_versions_expired_description": "An admin needs to update the workspace to a supported version in order to reenable access from mobile and desktop apps.", "Supported_versions_expired_description": "An admin needs to update the workspace to a supported version in order to reenable access from mobile and desktop apps.",
"Supported_versions_warning_update_required": "Update required" "Supported_versions_warning_update_required": "Update required",
"Pinned_a_message": "Pinned a message:"
} }

View File

@ -123,7 +123,6 @@
"Members": "Miembros", "Members": "Miembros",
"Mentions": "Menciones", "Mentions": "Menciones",
"Message_actions": "Acciones de mensaje", "Message_actions": "Acciones de mensaje",
"Message_pinned": "Mensaje fijado",
"Message_removed": "Mensaje eliminado", "Message_removed": "Mensaje eliminado",
"message": "mensaje", "message": "mensaje",
"messages": "mensajes", "messages": "mensajes",

View File

@ -223,7 +223,6 @@
"Members": "Jäsenet", "Members": "Jäsenet",
"Mentions": "Maininnat", "Mentions": "Maininnat",
"Message_actions": "Viestitoimet", "Message_actions": "Viestitoimet",
"Message_pinned": "Viesti kiinnitetty",
"Message_removed": "viesti poistettu", "Message_removed": "viesti poistettu",
"Message_starred": "Viesti merkitty tähdellä", "Message_starred": "Viesti merkitty tähdellä",
"Message_unstarred": "Viestin tähtimerkintä poistettu", "Message_unstarred": "Viestin tähtimerkintä poistettu",

View File

@ -211,7 +211,6 @@
"Members": "Membres", "Members": "Membres",
"Mentions": "Mentions", "Mentions": "Mentions",
"Message_actions": "Actions de message", "Message_actions": "Actions de message",
"Message_pinned": "Message épinglé",
"Message_removed": "Message supprimé", "Message_removed": "Message supprimé",
"Message_starred": "Message suivi", "Message_starred": "Message suivi",
"Message_unstarred": "Message non suivi", "Message_unstarred": "Message non suivi",

View File

@ -218,7 +218,6 @@
"Members": "Membri", "Members": "Membri",
"Mentions": "Menzioni", "Mentions": "Menzioni",
"Message_actions": "Azioni messaggio", "Message_actions": "Azioni messaggio",
"Message_pinned": "Messaggio appuntato",
"Message_removed": "Messaggio rimosso", "Message_removed": "Messaggio rimosso",
"Message_starred": "Messaggio importante", "Message_starred": "Messaggio importante",
"Message_unstarred": "Messaggio non importante", "Message_unstarred": "Messaggio non importante",

View File

@ -206,7 +206,6 @@
"Members": "メンバー", "Members": "メンバー",
"Mentions": "メンション", "Mentions": "メンション",
"Message_actions": "メッセージアクション", "Message_actions": "メッセージアクション",
"Message_pinned": "メッセージをピン留め",
"Message_removed": "メッセージを除く", "Message_removed": "メッセージを除く",
"message": "メッセージ", "message": "メッセージ",
"messages": "メッセージ", "messages": "メッセージ",

View File

@ -211,7 +211,6 @@
"Members": "Leden", "Members": "Leden",
"Mentions": "Vermeldingen", "Mentions": "Vermeldingen",
"Message_actions": "Berichtacties", "Message_actions": "Berichtacties",
"Message_pinned": "Bericht vastgezet",
"Message_removed": "Bericht verwijderd", "Message_removed": "Bericht verwijderd",
"Message_starred": "Bericht met ster", "Message_starred": "Bericht met ster",
"Message_unstarred": "Bericht zonder ster", "Message_unstarred": "Bericht zonder ster",

View File

@ -223,7 +223,6 @@
"Members": "Membros", "Members": "Membros",
"Mentions": "Menções", "Mentions": "Menções",
"Message_actions": "Ações", "Message_actions": "Ações",
"Message_pinned": "Fixou uma mensagem",
"Message_removed": "mensagem removida", "Message_removed": "mensagem removida",
"Message_starred": "Mensagem adicionada aos favoritos", "Message_starred": "Mensagem adicionada aos favoritos",
"Message_unstarred": "Mensagem removida dos favoritos", "Message_unstarred": "Mensagem removida dos favoritos",

View File

@ -206,7 +206,6 @@
"Members": "Membros", "Members": "Membros",
"Mentions": "Menções", "Mentions": "Menções",
"Message_actions": "Acções de mensagem", "Message_actions": "Acções de mensagem",
"Message_pinned": "Mensagem afixada",
"Message_removed": "Mensagem removida", "Message_removed": "Mensagem removida",
"Message_starred": "Mensagem estrelada", "Message_starred": "Mensagem estrelada",
"Message_unstarred": "Mensagem não estrelada", "Message_unstarred": "Mensagem não estrelada",
@ -350,5 +349,6 @@
"Open_Livechats": "Chats em andamento", "Open_Livechats": "Chats em andamento",
"Broadcast_hint": "Apenas utilizadores autorizados podem escrever novas mensagens, mas os outros utilizadores poderão responder", "Broadcast_hint": "Apenas utilizadores autorizados podem escrever novas mensagens, mas os outros utilizadores poderão responder",
"and_N_more": "e mais {{count}}", "and_N_more": "e mais {{count}}",
"Audio": "Áudio" "Audio": "Áudio",
"Pinned_a_message": "Fixou uma mensagem:"
} }

View File

@ -219,7 +219,6 @@
"Members": "Пользователи", "Members": "Пользователи",
"Mentions": "Упоминания", "Mentions": "Упоминания",
"Message_actions": "Действия с сообщением", "Message_actions": "Действия с сообщением",
"Message_pinned": "Сообщение прикреплено",
"Message_removed": "Сообщение удалено", "Message_removed": "Сообщение удалено",
"Message_starred": "Сообщение отмечено звездой", "Message_starred": "Сообщение отмечено звездой",
"Message_unstarred": "Отметка сообщения звездой удалена", "Message_unstarred": "Отметка сообщения звездой удалена",

View File

@ -218,7 +218,6 @@
"Members": "Člani", "Members": "Člani",
"Mentions": "Omembe", "Mentions": "Omembe",
"Message_actions": "Sporočila", "Message_actions": "Sporočila",
"Message_pinned": "Sporočilo pripeto",
"Message_removed": "Sporočilo odstranjeno", "Message_removed": "Sporočilo odstranjeno",
"Message_starred": "Sporočilo v zvezdi", "Message_starred": "Sporočilo v zvezdi",
"Message_unstarred": "Sporočilo neokuženo", "Message_unstarred": "Sporočilo neokuženo",

View File

@ -223,7 +223,6 @@
"Members": "Medlemmar", "Members": "Medlemmar",
"Mentions": "Omnämnanden", "Mentions": "Omnämnanden",
"Message_actions": "Åtgärder för meddelanden", "Message_actions": "Åtgärder för meddelanden",
"Message_pinned": "Meddelandet har fästs",
"Message_removed": "meddelande borttaget", "Message_removed": "meddelande borttaget",
"Message_starred": "Meddelandet har stjärnmarkerats", "Message_starred": "Meddelandet har stjärnmarkerats",
"Message_unstarred": "Stjärnmarkering borttagen för meddelande", "Message_unstarred": "Stjärnmarkering borttagen för meddelande",

View File

@ -202,7 +202,6 @@
"Members": "Üyeler", "Members": "Üyeler",
"Mentions": "Bahsetmeler", "Mentions": "Bahsetmeler",
"Message_actions": "İleti işlemleri", "Message_actions": "İleti işlemleri",
"Message_pinned": "İleti sabitlendi",
"Message_removed": "İleti kaldırıldı", "Message_removed": "İleti kaldırıldı",
"Message_starred": "İletia yıldız eklendi", "Message_starred": "İletia yıldız eklendi",
"Message_unstarred": "İletiın yıldızı kaldırıldı", "Message_unstarred": "İletiın yıldızı kaldırıldı",

View File

@ -198,7 +198,6 @@
"Members": "成员", "Members": "成员",
"Mentions": "被提及", "Mentions": "被提及",
"Message_actions": "信息操作", "Message_actions": "信息操作",
"Message_pinned": "信息被钉选",
"Message_removed": "信息被删除", "Message_removed": "信息被删除",
"Message_starred": "信息被标注", "Message_starred": "信息被标注",
"Message_unstarred": "信息被取消标注", "Message_unstarred": "信息被取消标注",

View File

@ -204,7 +204,6 @@
"Members": "成員", "Members": "成員",
"Mentions": "被提及", "Mentions": "被提及",
"Message_actions": "訊息操作", "Message_actions": "訊息操作",
"Message_pinned": "訊息被釘選",
"Message_removed": "訊息被刪除", "Message_removed": "訊息被刪除",
"Message_starred": "訊息被標註", "Message_starred": "訊息被標註",
"Message_unstarred": "訊息被取消標註", "Message_unstarred": "訊息被取消標註",