aboutsummaryrefslogtreecommitdiff
path: root/src/components/chat_list_item
diff options
context:
space:
mode:
authorShpuld Shpuldson <shp@cock.li>2020-07-12 11:11:12 +0300
committerShpuld Shpuldson <shp@cock.li>2020-07-12 11:11:12 +0300
commit4a6300bbeea97432afe5729c081a6b2a5e071883 (patch)
treec496355d2ce649e74156aa0c8587554226db29bc /src/components/chat_list_item
parent0c5e4f89e304b80ec1279f18f05809503132de24 (diff)
add simple You: to chat list last message
Diffstat (limited to 'src/components/chat_list_item')
-rw-r--r--src/components/chat_list_item/chat_list_item.js10
1 files changed, 6 insertions, 4 deletions
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 ? `<i>${this.$t('chats.you')}</i> ${content}` : content
return {
summary: '',
- statusnet_html: content,
- text: content,
+ statusnet_html: messagePreview,
+ text: messagePreview,
attachments: []
}
}