ref: cb5d7368b2b14d55607819d8899401e0944bdfae
parent: 0e606774b33138054e86c326946d78aa7d18a2cf
author: penny <penny@limitedideas.org>
date: Mon Oct 6 17:21:23 EDT 2025
fiddling with notification rcation rendering
--- a/mastodon.go
+++ b/mastodon.go
@@ -263,7 +263,7 @@
return
case *mastodon.DeleteEvent:
- _, ok := idmap[post.ID]
+ deleted, ok := idmap[post.ID]
//didn't have this in the cache
if !ok {capturedID := post.ID
@@ -276,12 +276,16 @@
}
return
}
+ formatter := &StatusFormatter{hc: hc, status: deleted, postContext: hc.homeref}+ templater := newStatusTemplateRenderer(formatter)
if hc.isPaused { hc.actionBuffer = append(hc.actionBuffer, func() {- //hc.printPostDetailed("", deleted, "Deleted:")+ line, _ := templater.render("Deleted: $standard_status")+ fmt.Print(line)
})
} else {- //hc.printPostDetailed("", deleted, "Deleted:")+ line, _ := templater.render("Deleted: $standard_status")+ fmt.Print(line)
}
return
--- a/notifications.go
+++ b/notifications.go
@@ -51,13 +51,13 @@
notifications = append(notifications, notification)
status := func(Notification *mastodon.Notification, plaintext string) {- notification := fmt.Sprintf("Notification [%s] from <%s>: %s", Notification.Type, Notification.Account.Acct, plaintext)- fmt.Println(hyphenate(notification))
+ notification := fmt.Sprintf("Notification [%s] from <%s>: %s\n", Notification.Type, Notification.Account.Acct, plaintext)+ fmt.Print(notification)
}
other := func(Notification *mastodon.Notification) {- notification := fmt.Sprintf("Notification [%s] from <%s>", Notification.Type, Notification.Account.Acct)- fmt.Println(hyphenate(notification))
+ notification := fmt.Sprintf("Notification [%s] from <%s>\n", Notification.Type, Notification.Account.Acct)+ fmt.Print(notification)
}
hc.PrintNotificationsCustom(notifications, status, other)
@@ -65,21 +65,18 @@
}
func (hc *Hellclient) PrintNotifications(notifications []*mastodon.Notification) {- fmt.Println(hc.RenderNotifications(notifications))
+ fmt.Print(hc.RenderNotifications(notifications))
}
func (hc *Hellclient) RenderNotificationsArray(notifications []*mastodon.Notification) []string {var noticeTexts []string
status := func(Notification *mastodon.Notification, plaintext string) {- notification := fmt.Sprintf("[%s] from <%s>: %s\n", Notification.Type, Notification.Account.Acct, plaintext)- notification, _ = hyphenate(notification)
-
+ notification := fmt.Sprintf("[%s] from <%s>: %s", Notification.Type, Notification.Account.Acct, plaintext)noticeTexts = append(noticeTexts, notification)
}
other := func(Notification *mastodon.Notification) {- notification := fmt.Sprintf("[%s] from <%s>\n", Notification.Type, Notification.Account.Acct)- notification, _ = hyphenate(notification)
+ notification := fmt.Sprintf("[%s] from <%s>", Notification.Type, Notification.Account.Acct)noticeTexts = append(noticeTexts, notification)
}
--- a/pages.go
+++ b/pages.go
@@ -188,7 +188,8 @@
noticeArray := noticeData.hc.RenderNotificationsArray(notices)
var itemArray []PageItem
for i := range noticeArray {- item := makePageItem(noticeArray[i])
+ itemtext, _ := hyphenate(noticeArray[i])
+ item := makePageItem(itemtext + "\n")
itemArray = append(itemArray, item)
}
noticeData.page.MinID = ""
--- a/references.go
+++ b/references.go
@@ -43,7 +43,6 @@
post, plaintext := hc.RenderPostPlaintext(post, *ref)
IncrementRef(ref, post)
ref.ref = IncrementString(ref.ref)
- plaintext, _ = hyphenate(plaintext)
return plaintext
}
--
⑨