From 7a8eae09ff68ccb040df45b2e0b23d3a1dcae4a3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 3 Jul 2015 18:29:46 +0100 Subject: [PATCH] More sender / sender display name fixes. --- skins/base/views/organisms/Notifier.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skins/base/views/organisms/Notifier.js b/skins/base/views/organisms/Notifier.js index e7bf40e782..09f1921ac3 100644 --- a/skins/base/views/organisms/Notifier.js +++ b/skins/base/views/organisms/Notifier.js @@ -38,7 +38,7 @@ var NotifierView = { } else if (ev.event.type == "m.room.member") { if (ev.event.state_key !== MatrixClientPeg.get().credentials.userId && "join" === ev.getContent().membership) { // Notify when another user joins - message = ev.target.name + " joined"; + message = senderDisplayName + " joined"; } else if (ev.event.state_key === MatrixClientPeg.get().credentials.userId && "invite" === ev.getContent().membership) { // notify when you are invited message = senderDisplayName + " invited you to a room"; @@ -59,9 +59,9 @@ var NotifierView = { if (!msg) return; var title; - if (room.name == ev.sender.name) { + if (!ev.sender || room.name == ev.sender.name) { title = room.name; - } else { + } else if (ev.sender) { title = ev.sender.name + " (" + room.name + ")"; }