ref: febf9fc93c07abb265a71dd9db53aa1bedc983bb
parent: d1285d9d3e239b94a2a2375945adf87033c7d927
author: penny <penny@limitedideas.org>
date: Mon Oct 6 09:48:09 EDT 2025
convert edits to templates
--- a/mastodon.go
+++ b/mastodon.go
@@ -194,11 +194,6 @@
return rendered
}
-func (hc *Hellclient) formatEdit(post *mastodon.Status, index string) string {- editString := fmt.Sprintf(" <%s> EDITED:", post.Account.Username)- return hc.formatStatusDetailed(post, index, editString)
-}
-
func printMastodonErr(err error) { fmt.Printf("\r%v\n", err)}
@@ -265,17 +260,20 @@
hc.stats.slock.Lock()
hc.stats.IncomingStatuses++
hc.stats.slock.Unlock()
+ formatter := &StatusFormatter{hc: hc, status: post.Status, postContext: hc.homeref}+ templater := newStatusTemplateRenderer(formatter)
if hc.isPaused {- currentPostRef := hc.homeref.ref
- capturedPost := post
hc.actionBuffer = append(hc.actionBuffer, func() {- fmt.Println(hc.formatEdit(capturedPost.Status, currentPostRef))
+ line, _ := templater.render(fmt.Sprintf("$username EDITED: %s> $content $media_descriptions\n", hc.homeref.ref + hc.homeref.prefix))+ fmt.Print(line)
})
justIncrementPostref(hc.homeref, post.Status)
idmap[post.Status.ID] = post.Status
return
}
- printAndIncrementDetailed(hc.homeref, post.Status, hc.formatEdit)
+ line, _ := templater.render(fmt.Sprintf("$username EDITED: %s> $content $media_descriptions\n", hc.homeref.ref + hc.homeref.prefix))+ fmt.Print(line)
+ justIncrementPostref(hc.homeref, post.Status)
idmap[post.Status.ID] = post.Status
return
--
⑨