mirror of https://github.com/vector-im/riot-web
Display room metadata from room previews when we come from the public room directory (more hacks to work around the fact that we can't get this data from the HS)
parent
c3b819b4da
commit
71cb04c50a
|
@ -66,9 +66,27 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
showRoom: function(roomId) {
|
||||
var room;
|
||||
for (var i = 0; i < this.state.publicRooms.length; ++i) {
|
||||
if (this.state.publicRooms[i].room_id == roomId) {
|
||||
room = this.state.publicRooms[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
var oob_data = {};
|
||||
if (room) {
|
||||
oob_data = {
|
||||
avatarUrl: room.avatar_url,
|
||||
// XXX: This logic is duplicated from the JS SDK which
|
||||
// would normally decide what the name is.
|
||||
name: room.name || room.aliases[0],
|
||||
};
|
||||
}
|
||||
|
||||
dis.dispatch({
|
||||
action: 'view_room',
|
||||
room_id: roomId
|
||||
room_id: roomId,
|
||||
oob_data: oob_data,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue