shithub: hell

Download patch

ref: 0b80f1a3a537166625c72ca46b32452abdf4eb45
parent: c2fc0147298b582aeb55eaed59f9ac0c4c2860cf
author: penny <penny@limitedideas.org>
date: Wed Oct 29 17:58:01 EDT 2025

initial command struct stuff

--- a/commands.go
+++ b/commands.go
@@ -90,3 +90,18 @@
 	}
 	return
 }
+
+
+type cmddata struct {
+	status *mastodon.Status
+	account *mastodon.Account
+	raw_argument string
+	command string
+	content string
+	index string
+}
+
+type cmd struct {
+	name string
+	data *cmddata
+}
\ No newline at end of file
--- a/main.go
+++ b/main.go
@@ -376,6 +376,10 @@
 				}
 				return
 			case "mark":
+				if !postOK {
+					fmt.Printf("mark requires a status to operate on\n")
+					return
+				}
 				markfunc := func() { _, err = client.Bookmark(context.Background(), postItem.ID) }
 				hc.dispatchAnon(markfunc).Wait()
 				if err != nil {
@@ -386,6 +390,10 @@
 				}
 				return
 			case "unmark":
+				if !postOK {
+					fmt.Printf("unmark requires a status to operate on\n")
+					return
+				}
 				var postCopy *mastodon.Status
 				unmarkfunc := func() {
 					postCopy, err = client.GetStatus(context.Background(), postItem.ID)
@@ -408,6 +416,11 @@
 				}
 				return
 			case "open":
+				if !postOK {
+					fmt.Printf("open requires a status to operate on\n")
+					return
+				}
+
 				url := fmt.Sprintf("%v/statuses/%v", client.Config.Server, postItem.ID)
 				openItemInOS(hc.preferences.Browser, url)
 				return
@@ -727,7 +740,9 @@
 
 			switch command {
 			case "reply":
-				hc.dispatchReply(content, postItem.SpoilerText, postItem.ID, postItem)
+				if postOK {
+					hc.dispatchReply(content, postItem.SpoilerText, postItem.ID, postItem)
+				}
 				return
 			}
 
--