summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-10-24 16:14:47 +0100
committerMatthew Hodgson <matthew@matrix.org>2014-10-24 16:14:47 +0100
commit1342bcedaf1ddf0f45009e7f771f51ee0c32ca6f (patch)
tree3288b0ba4adb7a2c359dff7b1257fe7db7368d9a
parentMerge branch 'master' into develop (diff)
downloadsynapse-1342bcedaf1ddf0f45009e7f771f51ee0c32ca6f.tar.xz
switch from the deprecated msg.content.prev to msg.prev_content.membership, and fix the bug where kicks of unjoined users aren't displayed sensibly in the history
-rw-r--r--webclient/components/matrix/event-handler-service.js2
-rw-r--r--webclient/recents/recents.html8
-rw-r--r--webclient/room/room.html8
3 files changed, 9 insertions, 9 deletions
diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js
index 492ec08bca..112b3ad96c 100644
--- a/webclient/components/matrix/event-handler-service.js
+++ b/webclient/components/matrix/event-handler-service.js
@@ -256,7 +256,7 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
             // could be a membership change, display name change, etc.
             // Find out which one.
             var memberChanges = undefined;
-            if (event.content.prev !== event.content.membership) {
+            if (event.prev_content && (event.prev_content.membership !== event.content.membership)) {
                 memberChanges = "membership";
             }
             else if (event.prev_content && (event.prev_content.displayname !== event.content.displayname)) {
diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html
index fe6a2f6368..a52b215c7e 100644
--- a/webclient/recents/recents.html
+++ b/webclient/recents/recents.html
@@ -42,12 +42,12 @@
                                         <span ng-if="lastMsg.user_id === lastMsg.state_key">
                                             {{lastMsg.state_key | mUserDisplayName: room.room_id }} left
                                         </span>
-                                        <span ng-if="lastMsg.user_id !== lastMsg.state_key">
+                                        <span ng-if="lastMsg.user_id !== lastMsg.state_key && lastMsg.prev_content">
                                             {{ lastMsg.user_id | mUserDisplayName: room.room_id }}
-                                            {{ {"join": "kicked", "ban": "unbanned"}[lastMsg.content.prev] }}
+                                            {{ {"invite": "kicked", "join": "kicked", "ban": "unbanned"}[lastMsg.prev_content.membership] }}
                                             {{ lastMsg.state_key | mUserDisplayName: room.room_id }}
                                         </span>
-                                        <span ng-if="'join' === lastMsg.content.prev && lastMsg.content.reason">
+                                        <span ng-if="lastMsg.prev_content && 'join' === lastMsg.prev_content.membership && lastMsg.content.reason">
                                             : {{ lastMsg.content.reason }}
                                         </span>
                                     </span>
@@ -55,7 +55,7 @@
                                         {{ lastMsg.user_id | mUserDisplayName: room.room_id }}
                                         {{ {"invite": "invited", "ban": "banned"}[lastMsg.content.membership] }}
                                         {{ lastMsg.state_key | mUserDisplayName: room.room_id }}
-                                        <span ng-if="'ban' === lastMsg.content.prev && lastMsg.content.reason">
+                                        <span ng-if="lastMsg.prev_content && 'ban' === lastMsg.prev_content.membership && lastMsg.content.reason">
                                             : {{ lastMsg.content.reason }}
                                         </span>
                                     </span>         
diff --git a/webclient/room/room.html b/webclient/room/room.html
index a3f8aee7ab..ce2c581903 100644
--- a/webclient/room/room.html
+++ b/webclient/room/room.html
@@ -91,11 +91,11 @@
                             <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">
+                            <span ng-if="msg.user_id !== msg.state_key && msg.prev_content">
                                 {{ members[msg.user_id].displayname || msg.user_id }}
-                                {{ {"join": "kicked", "ban": "unbanned"}[msg.content.prev] }}
+                                {{ {"invite": "kicked", "join": "kicked", "ban": "unbanned"}[msg.prev_content.membership] }}
                                 {{ members[msg.state_key].displayname || msg.state_key }}
-                                <span ng-if="'join' === msg.content.prev && msg.content.reason">
+                                <span ng-if="'join' === msg.prev_content.membership && msg.content.reason">
                                     : {{ msg.content.reason }}
                                 </span>
                             </span>
@@ -105,7 +105,7 @@
                             {{ members[msg.user_id].displayname || msg.user_id }}
                             {{ {"invite": "invited", "ban": "banned"}[msg.content.membership] }}
                             {{ members[msg.state_key].displayname || msg.state_key }}
-                            <span ng-if="'ban' === msg.content.prev && msg.content.reason">
+                            <span ng-if="msg.prev_content && 'ban' === msg.prev_content.membership && msg.content.reason">
                                 : {{ msg.content.reason }}
                             </span>
                         </span>