File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
src/components/structures Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -66,9 +66,31 @@ module.exports = React.createClass({
6666 } ,
6767
6868 showRoom : function ( roomId ) {
69+ // extract the metadata from the publicRooms structure to pass
70+ // as out-of-band data to view_room, because we get information
71+ // here that we can't get other than by joining the room in some
72+ // cases.
73+ var room ;
74+ for ( var i = 0 ; i < this . state . publicRooms . length ; ++ i ) {
75+ if ( this . state . publicRooms [ i ] . room_id == roomId ) {
76+ room = this . state . publicRooms [ i ] ;
77+ break ;
78+ }
79+ }
80+ var oob_data = { } ;
81+ if ( room ) {
82+ oob_data = {
83+ avatarUrl : room . avatar_url ,
84+ // XXX: This logic is duplicated from the JS SDK which
85+ // would normally decide what the name is.
86+ name : room . name || room . aliases [ 0 ] ,
87+ } ;
88+ }
89+
6990 dis . dispatch ( {
7091 action : 'view_room' ,
71- room_id : roomId
92+ room_id : roomId ,
93+ oob_data : oob_data ,
7294 } ) ;
7395 } ,
7496
You can’t perform that action at this time.
0 commit comments