2014-08-27 07:09:16 -06:00
|
|
|
<div ng-controller="RecentsController" data-ng-init="onInit()">
|
|
|
|
<table class="recentsTable">
|
2014-08-27 09:20:41 -06:00
|
|
|
<tbody ng-repeat="(rm_id, room) in rooms | orderRecents"
|
|
|
|
ng-click="goToPage('room/' + (room.room_alias ? room.room_alias : room.room_id) )"
|
|
|
|
class ="recentsRoom"
|
|
|
|
ng-class="{'recentsRoomSelected': (room.room_id === recentsSelectedRoomID)}">
|
2014-08-27 07:09:16 -06:00
|
|
|
<tr>
|
|
|
|
<td class="recentsRoomName">
|
2014-09-04 03:19:28 -06:00
|
|
|
{{ room.room_id | mRoomName }}
|
2014-08-27 07:09:16 -06:00
|
|
|
</td>
|
|
|
|
<td class="recentsRoomSummaryTS">
|
2014-09-08 15:01:34 -06:00
|
|
|
{{ room.numUsersInRoom || '1' }} {{ room.numUsersInRoom == 1 ? 'user' : 'users' }}
|
2014-09-08 12:55:19 -06:00
|
|
|
</td>
|
|
|
|
<td class="recentsRoomSummaryTS">
|
2014-08-27 07:09:16 -06:00
|
|
|
{{ (room.lastMsg.ts) | date:'MMM d HH:mm' }}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
2014-09-09 02:46:15 -06:00
|
|
|
<td colspan="3" class="recentsRoomSummary">
|
2014-08-27 07:09:16 -06:00
|
|
|
|
2014-09-05 06:55:17 -06:00
|
|
|
<div ng-show="room.membership === 'invite'">
|
|
|
|
{{ room.lastMsg.inviter | mUserDisplayName: room.room_id }} invited you
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-hide="room.membership === 'invite'" ng-switch="room.lastMsg.type">
|
2014-09-04 01:08:34 -06:00
|
|
|
<div ng-switch-when="m.room.member">
|
|
|
|
<span ng-if="'join' === room.lastMsg.content.membership">
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.state_key | mUserDisplayName: room.room_id}} joined
|
2014-09-04 01:08:34 -06:00
|
|
|
</span>
|
|
|
|
<span ng-if="'leave' === room.lastMsg.content.membership">
|
|
|
|
<span ng-if="room.lastMsg.user_id === room.lastMsg.state_key">
|
2014-09-04 05:57:27 -06:00
|
|
|
{{room.lastMsg.state_key | mUserDisplayName: room.room_id }} left
|
2014-09-04 01:08:34 -06:00
|
|
|
</span>
|
|
|
|
<span ng-if="room.lastMsg.user_id !== room.lastMsg.state_key">
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.user_id | mUserDisplayName: room.room_id }}
|
2014-09-04 01:08:34 -06:00
|
|
|
{{ {"join": "kicked", "ban": "unbanned"}[room.lastMsg.content.prev] }}
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.state_key | mUserDisplayName: room.room_id }}
|
2014-09-04 01:08:34 -06:00
|
|
|
</span>
|
2014-09-05 08:45:59 -06:00
|
|
|
<span ng-if="'join' === room.lastMsg.content.prev && room.lastMsg.content.reason">
|
|
|
|
: {{ room.lastMsg.content.reason }}
|
|
|
|
</span>
|
2014-09-04 01:08:34 -06:00
|
|
|
</span>
|
|
|
|
<span ng-if="'invite' === room.lastMsg.content.membership || 'ban' === room.lastMsg.content.membership">
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.user_id | mUserDisplayName: room.room_id }}
|
2014-09-04 01:08:34 -06:00
|
|
|
{{ {"invite": "invited", "ban": "banned"}[room.lastMsg.content.membership] }}
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.state_key | mUserDisplayName: room.room_id }}
|
2014-09-05 08:45:59 -06:00
|
|
|
<span ng-if="'ban' === room.lastMsg.content.prev && room.lastMsg.content.reason">
|
|
|
|
: {{ room.lastMsg.content.reason }}
|
|
|
|
</span>
|
2014-09-04 01:08:34 -06:00
|
|
|
</span>
|
2014-08-27 07:09:16 -06:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-when="m.room.message">
|
|
|
|
<div ng-switch="room.lastMsg.content.msgtype">
|
|
|
|
<div ng-switch-when="m.text">
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.user_id | mUserDisplayName: room.room_id }} :
|
2014-08-27 07:09:16 -06:00
|
|
|
<span ng-bind-html="(room.lastMsg.content.body) | linky:'_blank'">
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-when="m.image">
|
2014-09-04 05:57:27 -06:00
|
|
|
{{ room.lastMsg.user_id | mUserDisplayName: room.room_id }} sent an image
|
2014-08-27 07:09:16 -06:00
|
|
|
</div>
|
|
|
|
|
2014-08-29 01:49:03 -06:00
|
|
|
<div ng-switch-when="m.emote">
|
|
|
|
<span ng-bind-html="'* ' + (room.lastMsg.user_id) + ' ' + room.lastMsg.content.body | linky:'_blank'">
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
|
2014-08-27 07:09:16 -06:00
|
|
|
<div ng-switch-default>
|
|
|
|
{{ room.lastMsg.content }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div ng-switch-default>
|
2014-09-04 05:57:27 -06:00
|
|
|
<div ng-if="room.lastMsg.type.indexOf('m.call.') === 0">
|
2014-09-01 07:27:03 -06:00
|
|
|
Call
|
|
|
|
</div>
|
2014-08-27 07:09:16 -06:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|