From 006907e52f62627c66014f5b65debab8adc004d4 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 17 Jul 2015 09:47:30 +0100 Subject: [PATCH] Add kick message. Add reasons if given. --- skins/base/views/molecules/MRoomMemberTile.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/skins/base/views/molecules/MRoomMemberTile.js b/skins/base/views/molecules/MRoomMemberTile.js index b13b44a8f6..e79130c39d 100644 --- a/skins/base/views/molecules/MRoomMemberTile.js +++ b/skins/base/views/molecules/MRoomMemberTile.js @@ -33,20 +33,29 @@ module.exports = React.createClass({ // XXX: SYJS-16 var senderName = ev.sender ? ev.sender.name : "Someone"; var targetName = ev.target ? ev.target.name : "Someone"; + var reason = ev.getContent().reason ? ( + " Reason: " + ev.getContent().reason + ) : ""; switch (ev.getContent().membership) { case 'invite': return senderName + " invited " + targetName + "."; case 'ban': - return senderName + " banned " + targetName + "."; + return senderName + " banned " + targetName + "." + reason; case 'join': return targetName + " joined the room."; case 'leave': if (ev.getSender() === ev.getStateKey()) { return targetName + " left the room."; } - else { + else if (ev.getPrevContent().membership === "ban") { return senderName + " unbanned " + targetName + "."; } + else if (ev.getPrevContent().membership === "join") { + return senderName + " kicked " + targetName + "." + reason; + } + else { + return targetName + " left the room."; + } } },