@@ -42,6 +42,7 @@ import { logger } from "matrix-js-sdk/src/logger";
4242import { CallState , MatrixCall } from "matrix-js-sdk/src/webrtc/call" ;
4343import { throttle } from "lodash" ;
4444import { CryptoEvent } from "matrix-js-sdk/src/crypto" ;
45+ import { ViewRoomOpts } from "@matrix-org/react-sdk-module-api/lib/lifecycles/RoomViewLifecycle" ;
4546
4647import shouldHideEvent from "../../shouldHideEvent" ;
4748import { _t } from "../../languageHandler" ;
@@ -246,6 +247,8 @@ export interface IRoomState {
246247
247248 canAskToJoin : boolean ;
248249 promptAskToJoin : boolean ;
250+
251+ viewRoomOpts : ViewRoomOpts ;
249252}
250253
251254interface LocalRoomViewProps {
@@ -458,6 +461,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
458461 msc3946ProcessDynamicPredecessor : SettingsStore . getValue ( "feature_dynamic_room_predecessors" ) ,
459462 canAskToJoin : this . askToJoinEnabled ,
460463 promptAskToJoin : false ,
464+ viewRoomOpts : { buttons : [ ] } ,
461465 } ;
462466
463467 this . dispatcherRef = dis . register ( this . onAction ) ;
@@ -663,6 +667,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
663667 : false ,
664668 activeCall : roomId ? CallStore . instance . getActiveCall ( roomId ) : null ,
665669 promptAskToJoin : this . context . roomViewStore . promptAskToJoin ( ) ,
670+ viewRoomOpts : this . context . roomViewStore . getViewRoomOpts ( ) ,
666671 } ;
667672
668673 if (
@@ -1407,6 +1412,8 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
14071412 tombstone : this . getRoomTombstone ( room ) ,
14081413 liveTimeline : room . getLiveTimeline ( ) ,
14091414 } ) ;
1415+
1416+ dis . dispatch < ActionPayload > ( { action : Action . RoomLoaded } ) ;
14101417 } ;
14111418
14121419 private onRoomTimelineReset = ( room ?: Room ) : void => {
@@ -2601,7 +2608,10 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
26012608 data-layout = { this . state . layout }
26022609 >
26032610 { SettingsStore . getValue ( "feature_new_room_decoration_ui" ) ? (
2604- < RoomHeader room = { this . state . room } />
2611+ < RoomHeader
2612+ room = { this . state . room }
2613+ additionalButtons = { this . state . viewRoomOpts . buttons }
2614+ />
26052615 ) : (
26062616 < LegacyRoomHeader
26072617 room = { this . state . room }
@@ -2619,6 +2629,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
26192629 enableRoomOptionsMenu = { ! this . viewsLocalRoom }
26202630 viewingCall = { viewingCall }
26212631 activeCall = { this . state . activeCall }
2632+ additionalButtons = { this . state . viewRoomOpts . buttons }
26222633 />
26232634 ) }
26242635 { mainSplitBody }
0 commit comments