summary refs log tree commit diff
path: root/webclient/room/room.html
diff options
context:
space:
mode:
authorEmmanuel ROHEE <erohee@amdocs.com>2014-09-03 19:51:58 +0200
committerEmmanuel ROHEE <erohee@amdocs.com>2014-09-03 19:52:09 +0200
commit6322aa154b85f4389714111dd772ce144ee051fc (patch)
tree10f38e59097fb79068cf4e3d1de52a9750dcc6a6 /webclient/room/room.html
parentbetter error msgs (diff)
downloadsynapse-6322aa154b85f4389714111dd772ce144ee051fc.tar.xz
Added more ng-if to make nice sentences like "Bob kicked Alice" or "Bob unbanned Alice"
Diffstat (limited to 'webclient/room/room.html')
-rw-r--r--webclient/room/room.html17
1 files changed, 13 insertions, 4 deletions
diff --git a/webclient/room/room.html b/webclient/room/room.html
index 4b6a00bffa..6732a7b3ae 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -48,14 +48,23 @@
                 </td>
                 <td ng-class="!msg.content.membership ? (msg.content.msgtype === 'm.emote' ? 'emote text' : 'text') : 'membership text'">
                     <div class="bubble">
-                        <span ng-if="'join' === msg.content.membership || 'leave' === msg.content.membership">
-                            {{ members[msg.state_key].displayname || msg.state_key }}
-                            {{ {"join": "joined", "leave": "left"}[msg.content.membership] }}
+                        <span ng-if="'join' === msg.content.membership">
+                            {{ members[msg.state_key].displayname || msg.state_key }} joined
+                        </span>
+                        <span ng-if="'leave' === msg.content.membership">
+                            <span ng-if="msg.user_id === msg.state_key">
+                                {{ members[msg.state_key].displayname || msg.state_key }} left
+                            </span>
+                            <span ng-if="msg.user_id !== msg.state_key">
+                                {{ members[msg.user_id].displayname || msg.user_id }}
+                                {{ {"join": "kicked", "ban": "unbanned"}[msg.content.prev] }}
+                                {{ members[msg.state_key].displayname || msg.state_key }}
+                            </span>
                         </span>
                         <span ng-if="'invite' === msg.content.membership || 'ban' === msg.content.membership">
                             {{ members[msg.user_id].displayname || msg.user_id }}
                             {{ {"invite": "invited", "ban": "banned"}[msg.content.membership] }}
-                            {{ msg.state_key }}
+                            {{ members[msg.state_key].displayname || msg.state_key }}
                         </span>
                         <span ng-show='msg.content.msgtype === "m.emote"' ng-bind-html="'* ' + (members[msg.user_id].displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"/>
                         <span ng-show='msg.content.msgtype === "m.text"' ng-bind-html="((msg.content.msgtype === 'm.text') ? msg.content.body : '') | linky:'_blank'"/>