chiark / gitweb /
Reclassify status info as a utility activity.
authorSimon Tatham <anakin@pobox.com>
Wed, 3 Jan 2024 13:40:51 +0000 (13:40 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 3 Jan 2024 23:39:15 +0000 (23:39 +0000)
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.

src/activity_stack.rs
src/editor.rs
src/tui.rs

index e6ce5699ad60ac670dc199a0b5008c9303186cc9..acbf8cdd9182610e15e8ffe9549ac127835f7eb0 100644 (file)
@@ -4,7 +4,6 @@ pub enum NonUtilityActivity {
     HomeTimelineFile,
     PublicTimelineFile,
     LocalTimelineFile,
-    SinglePost(String),
     HashtagTimeline(String),
     ComposeToplevel,
     PostComposeMenu,
index 5f4612c5cfe816f55c039817c7795bff404a3d91..d90afb7f8b0fa8cc0dc006572a0197935d5e1005 100644 (file)
@@ -692,7 +692,7 @@ pub fn get_post_id_to_read() -> Box<dyn ActivityState> {
             } 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
index c9c79fb4e5bff4b2291fab8d13bc413d99e62e5e..7b50db1920102520678f1d7917755e2273ffae2d 100644 (file)
@@ -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())),