ref: 6bad701d58b194a4c4f25f266a9fc64ae75e51d0
parent: fc9854d5225f65a8dade6efba46da532952d33a5
author: penny <penny@limitedideas.org>
date: Tue Aug 19 16:52:35 EDT 2025
Gofmt pass
--- a/commands.go
+++ b/commands.go
@@ -40,18 +40,18 @@
func pullParameter(input string) (parameter string, remainder string) { if strings.HasPrefix(input, "?") {parameter, _, _ = strings.Cut(input, " ")
- if(len(parameter) == len(input)) {+ if len(parameter) == len(input) {remainder = ""
parameter = input
} else {- remainder = input[len(parameter)+1:]
+ remainder = input[len(parameter)+1:]
}
} else {return "", input
}
-
+
prefix, _, cut := strings.Cut(parameter, "\"")
-
+
if cut {quote, _, _ := strings.Cut(input[len(prefix)+1:], "\"")
parameter = prefix + quote
@@ -65,17 +65,16 @@
}
func splitParameter(input string) (parameter []string) {- if(len(input) < 2) {+ if len(input) < 2 {//nothing here
return nil
}
input = input[1:]
key, value, _ := strings.Cut(input, "=")
- return []string {key, value}+ return []string{key, value}}
func extractInputParameters(input string) (remainder string, parameters [][]string) {-
parameter := " "
remainder = input
for parameter != "" {@@ -83,6 +82,6 @@
if parameter != " " && parameter != "" {parameters = append(parameters, splitParameter(parameter))
}
- }
+ }
return
}
--- a/filtering.go
+++ b/filtering.go
@@ -2,8 +2,8 @@
import (
"context"
- "strconv"
"errors"
+ "strconv"
"github.com/mattn/go-mastodon"
)
@@ -24,7 +24,7 @@
if ID == 0 { return nil, errors.New("Filter not found")}
-
+
return
}
@@ -45,7 +45,7 @@
func (hc *Hellclient) GetOrCreateFilter(title string,
filtercontext []string, action string) (result *mastodon.FilterV2, err error) {ID, result := hc.getFilterID(title)
-
+
if ID == 0 {result, err = hc.createNewFilter(title, filtercontext, action)
if err == nil {@@ -55,13 +55,13 @@
if err != nil {return
}
-
+
return
}
func (hc *Hellclient) filterStatus(status *mastodon.Status) (result *mastodon.FilterV2, err error) { result, err = hc.GetOrCreateFilter("hellclient status filter", []string{"notifications", "public", "thread", "account", "home"}, "hide")-
+
if err != nil {return
}
@@ -73,11 +73,11 @@
func (hc *Hellclient) unfilterStatus(status *mastodon.Status) (result *mastodon.FilterV2, err error) { result, err = hc.getFilter("hellclient status filter")-
+
if err != nil {return
}
-
+
for _, resultstatus := range result.Statuses { if resultstatus.Status == status.ID {result, err = hc.client.FilterRemoveStatus(context.Background(), resultstatus.ID)
@@ -85,4 +85,4 @@
}
}
return nil, errors.New("Post not filtered")-}
\ No newline at end of file
+}
--- a/mastodon.go
+++ b/mastodon.go
@@ -213,6 +213,7 @@
return sb.String()
}
+
// Spaces before prefixes (no space if you're not passing a prefix)
func (hc *Hellclient) formatReblog(post *mastodon.Status, index string) string { reblogString := fmt.Sprintf(" <%v> Reblogged", post.Account.Username)--
⑨