2014-09-15 10:31:59 -04:00
|
|
|
<div ng-controller="RecentsController">
|
2014-08-27 09:09:16 -04:00
|
|
|
<table class="recentsTable">
|
2014-11-03 06:44:39 -05:00
|
|
|
<tbody ng-repeat="(index, room) in rooms | orderRecents"
|
2014-08-27 11:20:41 -04:00
|
|
|
ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )"
|
2014-09-23 20:12:59 -04:00
|
|
|
class="recentsRoom"
|
2014-09-15 10:31:59 -04:00
|
|
|
ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}">
|
2014-08-27 09:09:16 -04:00
|
|
|
<tr>
|
2014-11-03 06:44:39 -05:00
|
|
|
<td ng-class="room.current_room_state.state('m.room.join_rules').content.join_rule == 'public' ? 'recentsRoomName recentsPublicRoom' : 'recentsRoomName'">
|
2014-09-04 05:19:28 -04:00
|
|
|
{{ room.room_id | mRoomName }}
|
2014-08-27 09:09:16 -04:00
|
|
|
</td>
|
2014-09-16 11:07:47 -04:00
|
|
|
<td class="recentsRoomSummaryUsersCount">
|
2014-11-03 08:26:50 -05:00
|
|
|
<span ng-show="undefined !== room.recent.numUsersInRoom">
|
2014-11-03 06:44:39 -05:00
|
|
|
{{ room.recent.numUsersInRoom || '1' }} {{ room.recent.numUsersInRoom == 1 ? 'user' : 'users' }}
|
2014-09-10 10:46:06 -04:00
|
|
|
</span>
|
2014-09-08 14:55:19 -04:00
|
|
|
</td>
|
|
|
|
<td class="recentsRoomSummaryTS">
|
2014-09-15 10:31:59 -04:00
|
|
|
<!-- Use a temp var as alias to the last room message.
|
|
|
|
Declaring it in this way ensures the data-binding -->
|
2014-09-15 11:31:07 -04:00
|
|
|
{{ lastMsg = eventHandlerService.getLastMessage(room.room_id, true);"" }}
|
2014-09-15 10:31:59 -04:00
|
|
|
|
2014-10-17 18:53:24 -04:00
|
|
|
{{ (lastMsg.origin_server_ts) | date:'MMM d HH:mm' }}
|
2014-09-23 20:12:59 -04:00
|
|
|
|
|
|
|
<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"/>
|
2014-08-27 09:09:16 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2014-09-09 04:46:15 -04:00
|
|
|
<td colspan="3" class="recentsRoomSummary">
|
2014-08-27 09:09:16 -04:00
|
|
|
|
2014-11-03 08:48:08 -05:00
|
|
|
<div ng-show="room.recent.me.content.membership === 'invite'">
|
2014-11-03 06:44:39 -05:00
|
|
|
{{ room.recent.inviter | mUserDisplayName: room.room_id }} invited you
|
2014-09-05 08:55:17 -04:00
|
|
|
</div>
|
|
|
|
|
2014-11-03 06:44:39 -05:00
|
|
|
<div ng-hide="room.recent.me.membership === 'invite'" ng-switch="lastMsg.type">
|
2014-09-04 03:08:34 -04:00
|
|
|
<div ng-switch-when="m.room.member">
|
2014-09-24 06:48:24 -04:00
|
|
|
<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>
|
2014-10-24 11:14:47 -04:00
|
|
|
<span ng-if="lastMsg.user_id !== lastMsg.state_key && lastMsg.prev_content">
|
2014-09-24 06:48:24 -04:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }}
|
2014-10-24 11:14:47 -04:00
|
|
|
{{ {"invite": "kicked", "join": "kicked", "ban": "unbanned"}[lastMsg.prev_content.membership] }}
|
2014-09-24 06:48:24 -04:00
|
|
|
{{ lastMsg.state_key | mUserDisplayName: room.room_id }}
|
|
|
|
</span>
|
2014-10-24 11:14:47 -04:00
|
|
|
<span ng-if="lastMsg.prev_content && 'join' === lastMsg.prev_content.membership && lastMsg.content.reason">
|
2014-09-24 06:48:24 -04:00
|
|
|
: {{ 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 }}
|
2014-10-24 11:14:47 -04:00
|
|
|
<span ng-if="lastMsg.prev_content && 'ban' === lastMsg.prev_content.membership && lastMsg.content.reason">
|
2014-09-24 06:48:24 -04:00
|
|
|
: {{ lastMsg.content.reason }}
|
|
|
|
</span>
|
|
|
|
</span>
|
2014-09-04 03:08:34 -04:00
|
|
|
</span>
|
2014-09-24 06:48:24 -04:00
|
|
|
<span ng-switch-when="displayname">
|
|
|
|
{{ lastMsg.user_id }} changed their display name from {{ lastMsg.prev_content.displayname }} to {{ lastMsg.content.displayname }}
|
2014-09-05 10:45:59 -04:00
|
|
|
</span>
|
2014-09-04 03:08:34 -04:00
|
|
|
</span>
|
2014-08-27 09:09:16 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-when="m.room.message">
|
2014-09-15 10:31:59 -04:00
|
|
|
<div ng-switch="lastMsg.content.msgtype">
|
2014-08-27 09:09:16 -04:00
|
|
|
<div ng-switch-when="m.text">
|
2014-09-15 10:31:59 -04:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} :
|
|
|
|
<span ng-bind-html="(lastMsg.content.body) | linky:'_blank'">
|
2014-08-27 09:09:16 -04:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-when="m.image">
|
2014-09-15 10:31:59 -04:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} sent an image
|
2014-08-27 09:09:16 -04:00
|
|
|
</div>
|
|
|
|
|
2014-08-29 03:49:03 -04:00
|
|
|
<div ng-switch-when="m.emote">
|
2014-09-15 10:31:59 -04:00
|
|
|
<span ng-bind-html="'* ' + (lastMsg.user_id | mUserDisplayName: room.room_id) + ' ' + lastMsg.content.body | linky:'_blank'">
|
2014-08-29 03:49:03 -04:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
2014-08-27 09:09:16 -04:00
|
|
|
<div ng-switch-default>
|
2014-09-15 10:31:59 -04:00
|
|
|
{{ lastMsg.content }}
|
2014-08-27 09:09:16 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2014-09-11 05:31:24 -04:00
|
|
|
<div ng-switch-when="m.room.topic">
|
2014-09-15 10:31:59 -04:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} changed the topic to: {{ lastMsg.content.topic }}
|
2014-09-11 05:31:24 -04:00
|
|
|
</div>
|
|
|
|
|
2014-09-12 04:12:56 -04:00
|
|
|
<div ng-switch-when="m.room.name">
|
2014-09-15 10:31:59 -04:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} changed the room name to: {{ lastMsg.content.name }}
|
2014-09-12 04:12:56 -04:00
|
|
|
</div>
|
|
|
|
|
2014-08-27 09:09:16 -04:00
|
|
|
<div ng-switch-default>
|
2014-09-15 10:31:59 -04:00
|
|
|
<div ng-if="lastMsg.type.indexOf('m.call.') === 0">
|
2014-09-01 09:27:03 -04:00
|
|
|
Call
|
|
|
|
</div>
|
2014-08-27 09:09:16 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|