diff --git a/src/app.rs b/src/app.rs index 3a44552c..970fef36 100644 --- a/src/app.rs +++ b/src/app.rs @@ -478,9 +478,9 @@ impl MatchEvent for App { // Handle EventSourceModalAction to open/close the event source modal. match action.downcast_ref() { - Some(EventSourceModalAction::Open { room_id, event_id, original_json }) => { + Some(EventSourceModalAction::Open { room_id, event_id, latest_json }) => { self.ui.event_source_modal(cx, ids!(event_source_modal_inner)) - .show(cx, room_id.clone(), event_id.clone(), original_json.clone()); + .show(cx, room_id.clone(), event_id.clone(), latest_json.clone()); self.ui.modal(cx, ids!(event_source_modal)).open(cx); continue; } diff --git a/src/home/event_source_modal.rs b/src/home/event_source_modal.rs index 69405d24..f1edb1b2 100644 --- a/src/home/event_source_modal.rs +++ b/src/home/event_source_modal.rs @@ -167,7 +167,7 @@ script_mod! { text_style: TITLE_TEXT {font_size: 13}, color: #000 } - text: "Original event source" + text: "Latest event source" } copy_source_button := mod.widgets.CopyButton {} @@ -245,7 +245,7 @@ pub enum EventSourceModalAction { Open { room_id: OwnedRoomId, event_id: Option, - original_json: Option, + latest_json: Option, }, /// Close the modal. Close, @@ -257,7 +257,7 @@ pub struct EventSourceModal { #[deref] view: View, #[rust] room_id: Option, #[rust] event_id: Option, - #[rust] original_json: Option, + #[rust] latest_json: Option, } impl Widget for EventSourceModal { @@ -273,7 +273,7 @@ impl Widget for EventSourceModal { if let Some(event_id) = &self.event_id { self.view.label(cx, ids!(event_id_value)).set_text(cx, event_id.as_str()); } - if let Some(json) = &self.original_json { + if let Some(json) = &self.latest_json { self.view.code_view(cx, ids!(code_view)).set_text(cx, json); } self.view.draw_walk(cx, scope, walk) @@ -321,7 +321,7 @@ impl WidgetMatchEvent for EventSourceModal { } if self.view.button(cx, ids!(copy_source_button)).clicked(actions) { - if let Some(json) = &self.original_json { + if let Some(json) = &self.latest_json { cx.copy_to_clipboard(json); enqueue_popup_notification( "Copied event source to clipboard.", @@ -340,11 +340,11 @@ impl EventSourceModal { cx: &mut Cx, room_id: OwnedRoomId, event_id: Option, - original_json: Option, + latest_json: Option, ) { self.room_id = Some(room_id.clone()); self.event_id = event_id.clone(); - self.original_json = original_json.clone(); + self.latest_json = latest_json.clone(); self.view.button(cx, ids!(close_button)).reset_hover(cx); self.view.button(cx, ids!(room_id_copy_button)).reset_hover(cx); @@ -361,9 +361,9 @@ impl EventSourceModalRef { cx: &mut Cx, room_id: OwnedRoomId, event_id: Option, - original_json: Option, + latest_json: Option, ) { let Some(mut inner) = self.borrow_mut() else { return }; - inner.show(cx, room_id, event_id, original_json); + inner.show(cx, room_id, event_id, latest_json); } } diff --git a/src/home/room_screen.rs b/src/home/room_screen.rs index 9fc31060..6d210217 100644 --- a/src/home/room_screen.rs +++ b/src/home/room_screen.rs @@ -2028,9 +2028,9 @@ impl RoomScreen { ); continue; }; - // Get the original JSON from the event and pretty-print it - let original_json: Option = event_tl_item - .original_json() + // Get the latest JSON from the event and pretty-print it + let latest_json: Option = event_tl_item + .latest_json() .and_then(|raw_event| serde_json::to_value(raw_event).ok()) .and_then(|value| serde_json::to_string_pretty(&value).ok()); @@ -2039,7 +2039,7 @@ impl RoomScreen { cx.action(super::event_source_modal::EventSourceModalAction::Open { room_id: tl.kind.room_id().clone(), event_id, - original_json, + latest_json, }); } MessageAction::JumpToRelated(details) => {