shithub: hell

Download patch

ref: b6389cc0d5745e3bf29058610f73c0081842a5dd
parent: b0fd01dbd673c7637f22db70ca9039f820333a6b
author: penny <penny@limitedideas.org>
date: Thu Aug 21 19:54:48 EDT 2025

Edit command without HTML processing (broken)

--- a/commands.go
+++ b/commands.go
@@ -4,7 +4,7 @@
 	"strings"
 )
 
-var commands = []string{"examine", "reply", "like", "thread", "open", "preview", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "vim", "import", "pause", "resume", "url", "fpost", "ufpost"}
+var commands = []string{"examine", "reply", "like", "thread", "open", "preview", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "vim", "import", "pause", "resume", "url", "fpost", "ufpost", "edit"}
 
 func processInput(input string) (command string, arguments string) {
 
--- a/main.go
+++ b/main.go
@@ -267,6 +267,33 @@
 					postref = IncrementString(postref)
 				}
 				return
+			case "edit":
+				if content == "" || content == " " {
+					rl.SetDefault(fmt.Sprintf("/edit %v %v", index, postItem.Content))
+					return
+				}
+				var MediaIDs []mastodon.ID
+				for _, media := range postItem.MediaAttachments {
+					MediaIDs = append(MediaIDs, media.ID)
+				}
+				toot := &mastodon.Toot{
+					Status: content,
+					MediaIDs: MediaIDs,
+					Sensitive: postItem.Sensitive,
+					SpoilerText: postItem.SpoilerText,
+					Visibility: postItem.Visibility,
+					Language: postItem.Language,
+				}
+				if postItem.InReplyToID != nil {
+					id := mastodon.ID(postItem.InReplyToID.(string))
+					toot.InReplyToID = id
+				}
+				_, err = client.UpdateStatus(context.Background(), toot, postItem.ID)
+				if err != nil {
+					fmt.Println(err)
+					return
+				}
+				
 			case "thread":
 				context, err := client.GetStatusContext(context.Background(), postItem.ID)
 				if err != nil {
--