Do not show banned people in member list. Format ban events strings in room and recent flows

This commit is contained in:
Emmanuel ROHEE 2014-09-03 11:38:24 +02:00
parent 8ad056b207
commit 4ba5b4b55d
3 changed files with 10 additions and 4 deletions

View File

@ -23,8 +23,8 @@
<div ng-hide="room.membership === 'invite'" ng-switch="room.lastMsg.type" > <div ng-hide="room.membership === 'invite'" ng-switch="room.lastMsg.type" >
<div ng-switch-when="m.room.member"> <div ng-switch-when="m.room.member">
{{ room.lastMsg.user_id }} {{ room.lastMsg.user_id }}
{{ {"join": "joined", "leave": "left", "invite": "invited"}[room.lastMsg.content.membership] }} {{ {"join": "joined", "leave": "left", "invite": "invited", "ban": "banned"}[msg.content.membership] }}
{{ room.lastMsg.content.membership === "invite" ? (room.lastMsg.state_key || '') : '' }} {{ (msg.content.membership === "invite" || msg.content.membership === "ban") ? (msg.state_key || '') : '' }}
</div> </div>
<div ng-switch-when="m.room.message"> <div ng-switch-when="m.room.message">

View File

@ -161,6 +161,11 @@ angular.module('RoomController', ['ngSanitize', 'mFileInput'])
var updateMemberList = function(chunk) { var updateMemberList = function(chunk) {
if (chunk.room_id != $scope.room_id) return; if (chunk.room_id != $scope.room_id) return;
// Ignore banned people
if ("ban" === chunk.membership) {
return;
}
// set target_user_id to keep things clear // set target_user_id to keep things clear
var target_user_id = chunk.state_key; var target_user_id = chunk.state_key;

View File

@ -50,8 +50,9 @@
<div class="bubble"> <div class="bubble">
<span ng-show='msg.type === "m.room.member"'> <span ng-show='msg.type === "m.room.member"'>
{{ members[msg.user_id].displayname || msg.user_id }} {{ members[msg.user_id].displayname || msg.user_id }}
{{ {"join": "joined", "leave": "left", "invite": "invited"}[msg.content.membership] }} {{ {"join": "joined", "leave": "left", "invite": "invited", "ban": "banned"}[msg.content.membership] }}
{{ msg.content.membership === "invite" ? (msg.state_key || '') : '' }} {{ (msg.content.membership === "invite" || msg.content.membership === "ban") ? (msg.state_key || '') : '' }}
</span> </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.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'"/> <span ng-show='msg.content.msgtype === "m.text"' ng-bind-html="((msg.content.msgtype === 'm.text') ? msg.content.body : '') | linky:'_blank'"/>