ref: c83b73acec1bb90fe56f852c09af976c9079e409
parent: ca2ae011d88d237ecd88afcb26a69bf137d3eb57
author: penny <penny@limitedideas.org>
date: Wed Oct 8 19:00:58 EDT 2025
finalize removing heoving hellclient pointer from renderer
--- a/main.go
+++ b/main.go
@@ -245,7 +245,7 @@
hc.PrintObjectProperties(debugItem)
return
}
- formatter := &StatusFormatter{hc: hc, status: postItem, postContext: hc.ctxref, localindex: index}+ formatter := &StatusFormatter{prefs: hc.preferences, status: postItem, postContext: hc.ctxref, localindex: index}templater := newStatusTemplateRenderer(formatter)
//Commands require status indexes
--- a/mastodon.go
+++ b/mastodon.go
@@ -191,7 +191,7 @@
selectedPost = post
plaintext = fmt.Sprintf("$standard_status")}
- formatter := &StatusFormatter{hc: hc, status: post, postContext: &ref}+ formatter := &StatusFormatter{prefs: hc.preferences, status: post, postContext: &ref}templater := newStatusTemplateRenderer(formatter)
plaintext, _ = templater.render(plaintext)
return selectedPost, plaintext
@@ -245,7 +245,7 @@
hc.stats.slock.Lock()
hc.stats.IncomingStatuses++
hc.stats.slock.Unlock()
- formatter := &StatusFormatter{hc: hc, status: post.Status, postContext: hc.homeref}+ formatter := &StatusFormatter{prefs: hc.preferences, status: post.Status, postContext: hc.homeref}templater := newStatusTemplateRenderer(formatter)
if hc.isPaused { hc.actionBuffer = append(hc.actionBuffer, func() {@@ -276,7 +276,7 @@
}
return
}
- formatter := &StatusFormatter{hc: hc, status: deleted, postContext: hc.homeref}+ formatter := &StatusFormatter{prefs: hc.preferences, status: deleted, postContext: hc.homeref}templater := newStatusTemplateRenderer(formatter)
if hc.isPaused { hc.actionBuffer = append(hc.actionBuffer, func() {--- a/notifications.go
+++ b/notifications.go
@@ -58,7 +58,7 @@
func (hc *Hellclient) RenderNotificationsArray(notifications []*mastodon.Notification) []string {var noticeTexts []string
- formatter := &StatusFormatter{hc: hc, postContext: hc.ctxref}+ formatter := &StatusFormatter{prefs: hc.preferences, postContext: hc.ctxref}templater := newStatusTemplateRenderer(formatter)
for item := range notifications {formatter.notif = notifications[item]
--- a/pages.go
+++ b/pages.go
@@ -156,7 +156,7 @@
if err != nil { fmt.Printf("Couldn't load status page: %s\n", err)}
- formatter := &StatusFormatter{hc: statusData.hc, postContext: statusData.hc.ctxref}+ formatter := &StatusFormatter{prefs: statusData.hc.preferences, postContext: statusData.hc.ctxref}templater := newStatusTemplateRenderer(formatter)
for i := range statuses {formatter.status = statuses[i]
--- a/renderer.go
+++ b/renderer.go
@@ -15,6 +15,7 @@
status *mastodon.Status
postContext *postref
notif *mastodon.Notification
+ prefs *Hellprefs
// Index for posts that aren't using the ref in postref
localindex string
}
@@ -39,7 +40,7 @@
func (st *StatusFormatter) mediaDescriptions(reblog bool) string {var sb strings.Builder
status := st.status
- mediaTag := st.hc.preferences.MediaTag
+ mediaTag := st.prefs.MediaTag
if reblog {status = status.Reblog
}
--
⑨