From a3d8d53bd477d591473356e926b0c17bb17fbffc Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Mon, 18 May 2020 14:07:53 +0300 Subject: [PATCH] group chat msg preview: show author name --- src/js/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/app.js b/src/js/app.js index 39246a02..b6c1ea28 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -1232,6 +1232,9 @@ function addChat(channel) { if (!chats[pub].latest || msg.time > chats[pub].latest.time) { chats[pub].latest = msg; var text = truncateString(msg.text, 100); + if (chats[pub].uuid && !msg.selfAuthored && msg.info.from && chats[pub].participantProfiles[msg.info.from].name) { + text = chats[pub].participantProfiles[msg.info.from].name + ': ' + text; + } var now = new Date(); var latestTimeText = iris.util.getDaySeparatorText(msg.time, msg.time.toLocaleDateString({dateStyle:'short'})); if (latestTimeText === 'today') { latestTimeText = iris.util.formatTime(msg.time); }