From: Simon Tatham Date: Wed, 3 Jan 2024 13:40:51 +0000 (+0000) Subject: Reclassify status info as a utility activity. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=30b6eac2a32dbd2fe7ceca9bf65f2efcb8dd6ce9;p=mastodonochrome.git Reclassify status info as a utility activity. I meant it to be that in the first place - that's why I entered InfoStatus in the utilities enum. But then I forgot it was there and made a separate entry for it. When you're invoking status info from within a file, I think it makes more sense as a utility, the way I first had it. --- diff --git a/src/activity_stack.rs b/src/activity_stack.rs index e6ce569..acbf8cd 100644 --- a/src/activity_stack.rs +++ b/src/activity_stack.rs @@ -4,7 +4,6 @@ pub enum NonUtilityActivity { HomeTimelineFile, PublicTimelineFile, LocalTimelineFile, - SinglePost(String), HashtagTimeline(String), ComposeToplevel, PostComposeMenu, diff --git a/src/editor.rs b/src/editor.rs index 5f4612c..d90afb7 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -692,7 +692,7 @@ pub fn get_post_id_to_read() -> Box { } else { match client.status_by_id(s) { Ok(st) => LogicalAction::Goto( - NonUtilityActivity::SinglePost(st.id).into()), + UtilityActivity::InfoStatus(st.id).into()), // FIXME: it would be nice to discriminate errors // better here, and maybe return anything worse diff --git a/src/tui.rs b/src/tui.rs index c9c79fb..7b50db1 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -450,7 +450,7 @@ fn new_activity_state(activity: Activity, client: &mut Client, Ok(get_hashtag_to_read()), Activity::Util(UtilityActivity::ExamineUser(ref name)) => examine_user(client, name), - Activity::NonUtil(NonUtilityActivity::SinglePost(ref id)) => + Activity::Util(UtilityActivity::InfoStatus(ref id)) => view_single_post(client, id), Activity::NonUtil(NonUtilityActivity::ComposeToplevel) => compose_toplevel_post(client, post.unwrap_or_else(|| Post::new())),