2014-09-15 16:31:59 +02:00
|
|
|
<div ng-controller="RecentsController">
|
2014-08-27 15:09:16 +02:00
|
|
|
<table class="recentsTable">
|
2014-09-15 16:31:59 +02:00
|
|
|
<tbody ng-repeat="(index, room) in events.rooms | orderRecents"
|
2014-08-27 17:20:41 +02:00
|
|
|
ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )"
|
|
|
|
class ="recentsRoom"
|
2014-09-15 16:31:59 +02:00
|
|
|
ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}">
|
2014-08-27 15:09:16 +02:00
|
|
|
<tr>
|
|
|
|
<td class="recentsRoomName">
|
2014-09-04 11:19:28 +02:00
|
|
|
{{ room.room_id | mRoomName }}
|
2014-08-27 15:09:16 +02:00
|
|
|
</td>
|
|
|
|
<td class="recentsRoomSummaryTS">
|
2014-09-10 16:46:06 +02:00
|
|
|
<span ng-show="undefined !== room.numUsersInRoom">
|
|
|
|
{{ room.numUsersInRoom || '1' }} {{ room.numUsersInRoom == 1 ? 'user' : 'users' }}
|
|
|
|
</span>
|
2014-09-08 20:55:19 +02:00
|
|
|
</td>
|
|
|
|
<td class="recentsRoomSummaryTS">
|
2014-09-15 16:31:59 +02:00
|
|
|
<!-- Use a temp var as alias to the last room message.
|
|
|
|
Declaring it in this way ensures the data-binding -->
|
|
|
|
{{lastMsg = room.messages[room.messages.length - 1];""}}
|
|
|
|
|
|
|
|
{{ (lastMsg.ts) | date:'MMM d HH:mm' }}
|
2014-08-27 15:09:16 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2014-09-09 10:46:15 +02:00
|
|
|
<td colspan="3" class="recentsRoomSummary">
|
2014-08-27 15:09:16 +02:00
|
|
|
|
2014-09-05 14:55:17 +02:00
|
|
|
<div ng-show="room.membership === 'invite'">
|
2014-09-15 11:14:10 +02:00
|
|
|
{{ room.inviter | mUserDisplayName: room.room_id }} invited you
|
2014-09-05 14:55:17 +02:00
|
|
|
</div>
|
|
|
|
|
2014-09-15 16:31:59 +02:00
|
|
|
<div ng-hide="room.membership === 'invite'" ng-switch="lastMsg.type">
|
2014-09-04 09:08:34 +02:00
|
|
|
<div ng-switch-when="m.room.member">
|
2014-09-15 16:31:59 +02:00
|
|
|
<span ng-if="'join' === lastMsg.content.membership">
|
|
|
|
{{ lastMsg.state_key | mUserDisplayName: room.room_id}} joined
|
2014-09-04 09:08:34 +02:00
|
|
|
</span>
|
2014-09-15 16:31:59 +02:00
|
|
|
<span ng-if="'leave' === lastMsg.content.membership">
|
|
|
|
<span ng-if="lastMsg.user_id === lastMsg.state_key">
|
|
|
|
{{lastMsg.state_key | mUserDisplayName: room.room_id }} left
|
2014-09-04 09:08:34 +02:00
|
|
|
</span>
|
2014-09-15 16:31:59 +02:00
|
|
|
<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 }}
|
2014-09-04 09:08:34 +02:00
|
|
|
</span>
|
2014-09-15 16:31:59 +02:00
|
|
|
<span ng-if="'join' === lastMsg.content.prev && lastMsg.content.reason">
|
|
|
|
: {{ lastMsg.content.reason }}
|
2014-09-05 16:45:59 +02:00
|
|
|
</span>
|
2014-09-04 09:08:34 +02:00
|
|
|
</span>
|
2014-09-15 16:31:59 +02:00
|
|
|
<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 }}
|
2014-09-05 16:45:59 +02:00
|
|
|
</span>
|
2014-09-04 09:08:34 +02:00
|
|
|
</span>
|
2014-08-27 15:09:16 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-when="m.room.message">
|
2014-09-15 16:31:59 +02:00
|
|
|
<div ng-switch="lastMsg.content.msgtype">
|
2014-08-27 15:09:16 +02:00
|
|
|
<div ng-switch-when="m.text">
|
2014-09-15 16:31:59 +02:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} :
|
|
|
|
<span ng-bind-html="(lastMsg.content.body) | linky:'_blank'">
|
2014-08-27 15:09:16 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-when="m.image">
|
2014-09-15 16:31:59 +02:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} sent an image
|
2014-08-27 15:09:16 +02:00
|
|
|
</div>
|
|
|
|
|
2014-08-29 09:49:03 +02:00
|
|
|
<div ng-switch-when="m.emote">
|
2014-09-15 16:31:59 +02:00
|
|
|
<span ng-bind-html="'* ' + (lastMsg.user_id | mUserDisplayName: room.room_id) + ' ' + lastMsg.content.body | linky:'_blank'">
|
2014-08-29 09:49:03 +02:00
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
2014-08-27 15:09:16 +02:00
|
|
|
<div ng-switch-default>
|
2014-09-15 16:31:59 +02:00
|
|
|
{{ lastMsg.content }}
|
2014-08-27 15:09:16 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2014-09-11 11:31:24 +02:00
|
|
|
<div ng-switch-when="m.room.topic">
|
2014-09-15 16:31:59 +02:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} changed the topic to: {{ lastMsg.content.topic }}
|
2014-09-11 11:31:24 +02:00
|
|
|
</div>
|
|
|
|
|
2014-09-12 10:12:56 +02:00
|
|
|
<div ng-switch-when="m.room.name">
|
2014-09-15 16:31:59 +02:00
|
|
|
{{ lastMsg.user_id | mUserDisplayName: room.room_id }} changed the room name to: {{ lastMsg.content.name }}
|
2014-09-12 10:12:56 +02:00
|
|
|
</div>
|
|
|
|
|
2014-08-27 15:09:16 +02:00
|
|
|
<div ng-switch-default>
|
2014-09-15 16:31:59 +02:00
|
|
|
<div ng-if="lastMsg.type.indexOf('m.call.') === 0">
|
2014-09-01 15:27:03 +02:00
|
|
|
Call
|
|
|
|
</div>
|
2014-08-27 15:09:16 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|