@@ -7,7 +7,7 @@ use hashbrown::{HashMap, HashSet};
77use imbl:: Vector ;
88use makepad_widgets:: { image_cache:: ImageBuffer , * } ;
99use matrix_sdk:: {
10- OwnedServerName , RoomDisplayName , media:: { MediaFormat , MediaRequestParameters } , room:: RoomMember , ruma:: {
10+ OwnedServerName , media:: { MediaFormat , MediaRequestParameters } , room:: RoomMember , ruma:: {
1111 EventId , MatrixToUri , MatrixUri , OwnedEventId , OwnedMxcUri , OwnedRoomId , UserId , events:: {
1212 receipt:: Receipt ,
1313 room:: {
@@ -34,7 +34,7 @@ use crate::{
3434 shared:: {
3535 attachment_download:: { enqueue_already_downloading_notification, DownloadDisplayState , DownloadKind , DownloadableAttachment , PendingDownload , PendingDownloadState , media_source_mxc, start_attachment_download} , avatar:: { AvatarState , AvatarWidgetRefExt } , confirmation_modal:: ConfirmationModalContent , file_upload_modal:: FileUploadAttemptId , html_or_plaintext:: { HtmlOrPlaintextRef , HtmlOrPlaintextWidgetRefExt , RobrixHtmlLinkAction } , image_viewer:: { ImageViewerAction , ImageViewerMetaData , LoadState } , jump_to_bottom_button:: { JumpToBottomButtonWidgetExt , UnreadMessageCount } , popup_list:: { PopupKind , enqueue_popup_notification} , restore_status_view:: RestoreStatusViewWidgetExt , room_input_popup_menu:: { RoomInputPopupMenuAction , RoomInputPopupMenuWidgetExt } , styles:: * , text_or_image:: { TextOrImageAction , TextOrImageRef , TextOrImageStatus , TextOrImageWidgetRefExt } , timestamp:: TimestampWidgetRefExt
3636 } ,
37- sliding_sync:: { BackwardsPaginateUntilEventRequest , MatrixRequest , PaginationDirection , TimelineEndpoints , TimelineKind , TimelineRequestSender , UserPowerLevels , get_client , submit_async_request, take_timeline_endpoints} , utils:: { self , ImageFormat , MEDIA_THUMBNAIL_FORMAT , RoomNameId , unix_time_millis_to_datetime}
37+ sliding_sync:: { BackwardsPaginateUntilEventRequest , MatrixRequest , PaginationDirection , TimelineEndpoints , TimelineKind , TimelineRequestSender , UserPowerLevels , submit_async_request, take_timeline_endpoints} , utils:: { self , ImageFormat , MEDIA_THUMBNAIL_FORMAT , RoomNameId , unix_time_millis_to_datetime}
3838} ;
3939use crate :: home:: event_reaction_list:: ReactionListWidgetRefExt ;
4040use crate :: home:: room_read_receipt:: AvatarRowWidgetRefExt ;
@@ -1067,37 +1067,19 @@ impl Widget for RoomScreen {
10671067 // so the only thing we'd need here is the conditional below.
10681068
10691069 if !is_pane_shown || !is_interactive_hit {
1070- // Create a Scope with RoomScreenProps containing the room members .
1070+ // Create a Scope with RoomScreenProps.
10711071 // This scope is needed by child widgets like MentionableTextInput during event handling.
10721072 let room_props = if let Some ( tl) = self . tl_state . as_ref ( ) {
1073- let room_id = tl. kind . room_id ( ) . clone ( ) ;
1074- let room_members = tl. room_members . clone ( ) ;
1075-
1076- // Fetch room data once to avoid duplicate expensive lookups
1077- let ( room_display_name, room_avatar_url) = get_client ( )
1078- . and_then ( |client| client. get_room ( & room_id) )
1079- . map ( |room| (
1080- room. cached_display_name ( ) . unwrap_or ( RoomDisplayName :: Empty ) ,
1081- room. avatar_url ( )
1082- ) )
1083- . unwrap_or ( ( RoomDisplayName :: Empty , None ) ) ;
1084-
10851073 RoomScreenProps {
10861074 room_screen_widget_uid,
1087- room_name_id : RoomNameId :: new ( room_display_name, room_id) ,
10881075 timeline_kind : tl. kind . clone ( ) ,
1089- room_members,
1090- room_avatar_url,
10911076 }
1092- } else if let Some ( room_name ) = & self . room_name_id {
1077+ } else if self . room_name_id . is_some ( ) {
10931078 // Fallback case: we have a room_name but no tl_state yet
10941079 RoomScreenProps {
10951080 room_screen_widget_uid,
1096- room_name_id : room_name. clone ( ) ,
10971081 timeline_kind : self . timeline_kind . clone ( )
10981082 . expect ( "BUG: room_name_id was set but timeline_kind was missing" ) ,
1099- room_members : None ,
1100- room_avatar_url : None ,
11011083 }
11021084 } else {
11031085 // No room selected yet, skip event handling that requires room context
@@ -1109,10 +1091,7 @@ impl Widget for RoomScreen {
11091091 let room_id = owned_room_id ! ( "!dummy:matrix.org" ) ;
11101092 RoomScreenProps {
11111093 room_screen_widget_uid,
1112- room_name_id : RoomNameId :: empty ( room_id. clone ( ) ) ,
11131094 timeline_kind : TimelineKind :: MainRoom { room_id } ,
1114- room_members : None ,
1115- room_avatar_url : None ,
11161095 }
11171096 } ;
11181097 let mut room_scope = Scope :: with_props ( & room_props) ;
@@ -2924,10 +2903,7 @@ impl RoomScreenRef {
29242903/// from a RoomScreen widget to its child widgets for event/draw handlers.
29252904pub struct RoomScreenProps {
29262905 pub room_screen_widget_uid : WidgetUid ,
2927- pub room_name_id : RoomNameId ,
29282906 pub timeline_kind : TimelineKind ,
2929- pub room_members : Option < Arc < Vec < RoomMember > > > ,
2930- pub room_avatar_url : Option < OwnedMxcUri > ,
29312907}
29322908
29332909
0 commit comments