From 4a6300bbeea97432afe5729c081a6b2a5e071883 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Sun, 12 Jul 2020 11:11:12 +0300 Subject: add simple You: to chat list last message --- src/components/chat_list_item/chat_list_item.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/components/chat_list_item') diff --git a/src/components/chat_list_item/chat_list_item.js b/src/components/chat_list_item/chat_list_item.js index b6b0519a..bee1ad53 100644 --- a/src/components/chat_list_item/chat_list_item.js +++ b/src/components/chat_list_item/chat_list_item.js @@ -37,12 +37,14 @@ const ChatListItem = { } }, messageForStatusContent () { - const content = this.chat.lastMessage ? (this.attachmentInfo || this.chat.lastMessage.content) : '' - + const message = this.chat.lastMessage + const isYou = message && message.account_id === this.currentUser.id + const content = message ? (this.attachmentInfo || message.content) : '' + const messagePreview = isYou ? `${this.$t('chats.you')} ${content}` : content return { summary: '', - statusnet_html: content, - text: content, + statusnet_html: messagePreview, + text: messagePreview, attachments: [] } } -- cgit v1.2.3-70-g09d2