mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-22 12:54:57 -05:00
Added num_joined_users key to /publicRooms for each room. Show this information in the webclient.
This commit is contained in:
parent
942d8412c4
commit
76fe7d4eba
@ -593,6 +593,12 @@ class RoomListHandler(BaseHandler):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def get_public_room_list(self):
|
def get_public_room_list(self):
|
||||||
chunk = yield self.store.get_rooms(is_public=True)
|
chunk = yield self.store.get_rooms(is_public=True)
|
||||||
|
for room in chunk:
|
||||||
|
joined_members = yield self.store.get_room_members(
|
||||||
|
room_id=room["room_id"],
|
||||||
|
membership=Membership.JOIN
|
||||||
|
)
|
||||||
|
room["num_joined_members"] = len(joined_members)
|
||||||
# FIXME (erikj): START is no longer a valid value
|
# FIXME (erikj): START is no longer a valid value
|
||||||
defer.returnValue({"start": "START", "end": "END", "chunk": chunk})
|
defer.returnValue({"start": "START", "end": "END", "chunk": chunk})
|
||||||
|
|
||||||
|
@ -273,6 +273,10 @@ a:active { color: #000; }
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.publicRoomEntry {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
/*** Participant list ***/
|
/*** Participant list ***/
|
||||||
|
|
||||||
#usersTableWrapper {
|
#usersTableWrapper {
|
||||||
|
@ -25,11 +25,14 @@
|
|||||||
<h3>Public rooms</h3>
|
<h3>Public rooms</h3>
|
||||||
|
|
||||||
<div class="public_rooms" ng-repeat="room in public_rooms | orderBy:'room_display_name'">
|
<div class="public_rooms" ng-repeat="room in public_rooms | orderBy:'room_display_name'">
|
||||||
<div>
|
<div class="publicRoomEntry">
|
||||||
<a href="#/room/{{ room.room_alias ? room.room_alias : room.room_id }}"
|
<a href="#/room/{{ room.room_alias ? room.room_alias : room.room_id }}"
|
||||||
ng-class="room.room_display_name.toLowerCase().indexOf('#matrix:') === 0 ? 'roomHighlight' : ''">
|
ng-class="room.room_display_name.toLowerCase().indexOf('#matrix:') === 0 ? 'roomHighlight' : ''">
|
||||||
{{ room.room_display_name }}
|
{{ room.room_display_name }}
|
||||||
</a>
|
</a>
|
||||||
|
<div ng-show="'num_joined_members' in room">
|
||||||
|
{{ room.num_joined_members }} {{ room.num_joined_members == 1 ? 'user' : 'users' }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
{{ room.room_id | mRoomName }}
|
{{ room.room_id | mRoomName }}
|
||||||
</td>
|
</td>
|
||||||
<td class="recentsRoomSummaryTS">
|
<td class="recentsRoomSummaryTS">
|
||||||
{{ room.numUsersInRoom }} users
|
{{ room.numUsersInRoom }} {{ room.numUsersInRoom == 1 ? 'user' : 'users' }}
|
||||||
</td>
|
</td>
|
||||||
<td class="recentsRoomSummaryTS">
|
<td class="recentsRoomSummaryTS">
|
||||||
{{ (room.lastMsg.ts) | date:'MMM d HH:mm' }}
|
{{ (room.lastMsg.ts) | date:'MMM d HH:mm' }}
|
||||||
|
Loading…
Reference in New Issue
Block a user