ref: c0b8f2f58ceea2dd5adbc8e09380c15057a97a1a
parent: 11884bffdbfcd656a8677854761dfa8428d61561
author: penny <penny@limitedideas.org>
date: Fri Sep 26 12:56:45 EDT 2025
goimports pass
--- a/filehandler.go
+++ b/filehandler.go
@@ -9,8 +9,8 @@
"os/exec"
"path"
- "github.com/google/shlex"
"codeberg.org/penny64/hellclient-go-mastodon"
+ "github.com/google/shlex"
)
func (hc *Hellclient) previewPostImages(target *mastodon.Status, commandstring string) (err error) {--- a/hellclient.go
+++ b/hellclient.go
@@ -9,8 +9,8 @@
"sync"
"time"
- "github.com/ergochat/readline"
"codeberg.org/penny64/hellclient-go-mastodon"
+ "github.com/ergochat/readline"
)
var (
@@ -46,9 +46,9 @@
urlMap map[string][]string
debugMap map[string]interface{}actionBuffer []func()
-
+
//pointer to our current page item
- page *Page
+ page *Page
stats *Stats
}
--- a/helpers.go
+++ b/helpers.go
@@ -6,4 +6,4 @@
reversed = append(reversed, array[i])
}
return reversed
-}
\ No newline at end of file
+}
--- a/main.go
+++ b/main.go
@@ -10,8 +10,8 @@
"strings"
"time"
- "github.com/k3a/html2text"
"codeberg.org/penny64/hellclient-go-mastodon"
+ "github.com/k3a/html2text"
)
func main() {@@ -109,7 +109,7 @@
sb.WriteString(fmt.Sprintf("API Calls: %d\n", hc.stats.APICalls)) sb.WriteString(fmt.Sprintf("Statuses Received: %d\n", hc.stats.IncomingStatuses)) sb.WriteString("Statuses per hour:")- sb.WriteString(fmt.Sprintf("%.2f\n", float32(hc.stats.IncomingStatuses) / (float32(time.Since(hc.stats.StartedTime)) / float32(time.Hour))))+ sb.WriteString(fmt.Sprintf("%.2f\n", float32(hc.stats.IncomingStatuses)/(float32(time.Since(hc.stats.StartedTime))/float32(time.Hour)))) sb.WriteString(fmt.Sprintf("Started At: %s\n", hc.stats.StartedTime))timeSince := time.Since(hc.stats.StartedTime)
timeSince = timeSince.Round(time.Second)
--- a/mastodon.go
+++ b/mastodon.go
@@ -9,8 +9,8 @@
"strings"
"time"
- "github.com/k3a/html2text"
"codeberg.org/penny64/hellclient-go-mastodon"
+ "github.com/k3a/html2text"
"golang.org/x/net/html"
)
--- a/notifications.go
+++ b/notifications.go
@@ -81,7 +81,7 @@
}
hc.PrintNotificationsCustom(notifications, status, other)
-
+
return noticeTexts
}
--- a/pages.go
+++ b/pages.go
@@ -4,7 +4,7 @@
"context"
"fmt"
"strings"
-
+
"codeberg.org/penny64/hellclient-go-mastodon"
"golang.org/x/term"
)
@@ -19,7 +19,7 @@
type BasicStatusGetter struct {getter func(ctx context.Context, pg *mastodon.Pagination) ([]*mastodon.Status, error)
- page *mastodon.Pagination
+ page *mastodon.Pagination
}
func (getter *BasicStatusGetter) Get(limit int) ([]*mastodon.Status, error) {@@ -31,6 +31,7 @@
getter.page.MinID = ""
return statuses, err
}
+
type Page struct {loader StatusLoader
//Array index for the item buffer
@@ -40,17 +41,16 @@
//our previous index for going back
previndexes []int
//Semantic page number for the UI
- page int
+ page int
itembuffer *[]PageItem
-
}
type NotificationPages struct {- hc *Hellclient
+ hc *Hellclient
page *mastodon.Pagination
}
type StatusPages struct {- hc *Hellclient
+ hc *Hellclient
prefix string
getter StatusGetter
}
@@ -87,7 +87,9 @@
noticeData.page.Limit = int64(limit)
var notices []*mastodon.Notification
var err error
- getnotifs := func(job *GenericJob){notices, err = noticeData.hc.client.GetNotifications(context.Background(), noticeData.page)}+ getnotifs := func(job *GenericJob) {+ notices, err = noticeData.hc.client.GetNotifications(context.Background(), noticeData.page)
+ }
notifjob := noticeData.hc.dispatchFunc(getnotifs)
notifjob.Wait()
if err != nil {@@ -181,7 +183,7 @@
func (page *Page) Prev() {page.findIndexStart()
if page.page > 0 {- page.page--
+ page.page--
}
}
--
⑨