ref: bf928334986d8027cbff3ad2fe3c1b3c69b787e4
parent: 16fd80edde8e3928854f8e600c5037459b97163d
author: penny <penny@limitedideas.org>
date: Sat Sep 27 11:05:04 EDT 2025
add /unfollow too
--- 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", "vim", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice", "stats", "next", "preview", "bookmarks", "follow"}+var commands = []string{"examine", "reply", "like", "thread", "open", "prev", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "vim", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice", "stats", "next", "preview", "bookmarks", "follow", "unfollow"} func processInput(input string) (command string, arguments string, found bool) {--- a/main.go
+++ b/main.go
@@ -356,6 +356,28 @@
(*hc.page.itembuffer)[0].lines = -1
fmt.Print(hc.page.String())
return
+ case "unfollow":
+ var account *mastodon.Account
+ if foundindex {+ account = &postItem.Account
+ } else {+ account = hc.resolveAccount(index)
+ if account == nil {+ return
+ }
+ }
+ relationship, err := hc.client.AccountUnfollow(context.Background(), account.ID)
+ if err != nil {+ fmt.Printf("Error unfollowing account\n", err)+ return
+ }
+ if !relationship.Following {+ fmt.Printf("Successfully unfollowed %s\n", index)+ return
+ }
+ fmt.Printf("Unknown failure, account is still followed\n")+ return
+
case "follow":
var account *mastodon.Account
if foundindex {--
⑨