diff options
Diffstat (limited to 'webclient/recents')
-rw-r--r-- | webclient/recents/recents.html | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/webclient/recents/recents.html b/webclient/recents/recents.html index edfc1677eb..9cbdcd357a 100644 --- a/webclient/recents/recents.html +++ b/webclient/recents/recents.html @@ -2,7 +2,7 @@ <table class="recentsTable"> <tbody ng-repeat="(index, room) in events.rooms | orderRecents" ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )" - class ="recentsRoom" + class="recentsRoom" ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}"> <tr> <td ng-class="room['m.room.join_rules'].content.join_rule == 'public' ? 'recentsRoomName recentsPublicRoom' : 'recentsRoomName'"> @@ -19,6 +19,8 @@ {{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }} {{ (lastMsg.ts) | date:'MMM d HH:mm' }} + + <img ng-click="leave(room.room_id); $event.stopPropagation();" src="img/close.png" width="10" height="10" style="margin-bottom: -1px; margin-left: 2px;" alt="close"/> </td> </tr> @@ -31,28 +33,35 @@ <div ng-hide="room.membership === 'invite'" ng-switch="lastMsg.type"> <div ng-switch-when="m.room.member"> - <span ng-if="'join' === lastMsg.content.membership"> - {{ lastMsg.state_key | mUserDisplayName: room.room_id}} joined - </span> - <span ng-if="'leave' === lastMsg.content.membership"> - <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"> - {{ lastMsg.user_id | mUserDisplayName: room.room_id }} - {{ {"join": "kicked", "ban": "unbanned"}[lastMsg.content.prev] }} - {{ lastMsg.state_key | mUserDisplayName: room.room_id }} - </span> - <span ng-if="'join' === lastMsg.content.prev && lastMsg.content.reason"> - : {{ lastMsg.content.reason }} + <span ng-switch="lastMsg.changedKey"> + <span ng-switch-when="membership"> + <span ng-if="'join' === lastMsg.content.membership"> + {{ lastMsg.state_key | mUserDisplayName: room.room_id }} joined + </span> + <span ng-if="'leave' === lastMsg.content.membership"> + <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"> + {{ lastMsg.user_id | mUserDisplayName: room.room_id }} + {{ {"join": "kicked", "ban": "unbanned"}[lastMsg.content.prev] }} + {{ lastMsg.state_key | mUserDisplayName: room.room_id }} + </span> + <span ng-if="'join' === lastMsg.content.prev && lastMsg.content.reason"> + : {{ lastMsg.content.reason }} + </span> + </span> + <span ng-if="'invite' === lastMsg.content.membership || 'ban' === lastMsg.content.membership"> + {{ 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"> + : {{ lastMsg.content.reason }} + </span> + </span> </span> - </span> - <span ng-if="'invite' === lastMsg.content.membership || 'ban' === lastMsg.content.membership"> - {{ 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"> - : {{ lastMsg.content.reason }} + <span ng-switch-when="displayname"> + {{ lastMsg.user_id }} changed their display name from {{ lastMsg.prev_content.displayname }} to {{ lastMsg.content.displayname }} </span> </span> </div> |