shithub: hell

Download patch

ref: 078c23e447246952aae7eec077828256eea49966
parent: dfd632766105767580729ffa5f63f7a55e4cb882
author: penny <penny@limitedideas.org>
date: Tue Oct 21 16:35:35 EDT 2025

enable unlike command

--- a/commands.go
+++ b/commands.go
@@ -4,7 +4,7 @@
 	"strings"
 )
 
-var commands = []string{"examine", "reply", "like", "thread", "open", "prev", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice", "stats", "next", "view", "bookmarks", "follow", "unfollow", "likes", "help", "reload", "attach", "detach", "pinned", "cat", "play", "translate", "read", "version", "local", "public", "block", "unblock"}
+var commands = []string{"examine", "reply", "like", "thread", "open", "prev", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice", "stats", "next", "view", "bookmarks", "follow", "unfollow", "likes", "help", "reload", "attach", "detach", "pinned", "cat", "play", "translate", "read", "version", "local", "public", "block", "unblock", "unlike"}
 
 func processInput(input string) (command string, arguments string, found bool) {
 
--- a/help.go
+++ b/help.go
@@ -13,6 +13,7 @@
   /help                        Show this help message.
   /reply <index> content       Reply to status by index.
   /like <index>                Favorite status by index.
+  /unlike <index>              Unfavorite status by index.
   /thread <index>              View thread the indexed status is part of.
   /cat <index>                 Output a status with details (liker, replies, etc).
   /public                      Open federated timeline page.
--- a/main.go
+++ b/main.go
@@ -336,6 +336,18 @@
 					fmt.Print(line)
 				}
 				return
+			case "unlike":
+				likefunc := func() {
+					_, err = client.Unfavourite(context.Background(), postItem.ID)
+				}
+				hc.dispatchAnon(likefunc).Wait()
+				if err != nil {
+					printMastodonErr(err)
+				} else {
+					line, _ := templater.render("Unfavourited: $standard_status")
+					fmt.Print(line)
+				}
+				return
 			case "mark":
 				markfunc := func() { _, err = client.Bookmark(context.Background(), postItem.ID) }
 				hc.dispatchAnon(markfunc).Wait()
--