shithub: hell

Download patch

ref: 00f57e46e617dd29b735f787060ae98f7007ed5b
parent: 669115f1219e7ba31100740ad6dbe3e14a6667e7
author: penny <penny@limitedideas.org>
date: Fri Sep 5 20:14:05 EDT 2025

Notification command sets notifications read

--- a/hellclient.go
+++ b/hellclient.go
@@ -70,6 +70,8 @@
 	var hc Hellclient
 
 	defer func() {
+		//Got some stuff to do when we're done
+		hc.updatePrompt()
 		//start up post dispatcher
 		go hc.clientDispatch()
 	}()
--- a/main.go
+++ b/main.go
@@ -110,6 +110,13 @@
 			case "notice":
 				notifications, _ := hc.GetUnreadNotifications()
 				hc.PrintNotifications(notifications)
+				err = hc.SetNotificationsRead(notifications[0].ID)
+				if err != nil {
+					fmt.Println(err)
+					return
+				}
+				hc.updatePrompt()
+				hc.pause(true)
 				return
 			case "pause":
 				hc.togglepause()
--- a/mastodon.go
+++ b/mastodon.go
@@ -313,7 +313,6 @@
 	initReferenceSystem()
 
 	postref := "a"
-	plaintext := ""
 	idmap := make(map[mastodon.ID]*mastodon.Status)
 
 	// Enter a loop to continuously listen for events from the event channel.
--- a/notifications.go
+++ b/notifications.go
@@ -19,6 +19,21 @@
 	return
 }
 
+func (hc *Hellclient) SetNotificationsRead(ID mastodon.ID) (err error) {
+
+	markers, err := hc.client.GetTimelineMarkers(context.Background(), []string{"notifications"})
+	if err != nil {
+		return
+	}
+	
+	marker := markers["notifications"]
+	marker.ID = ID
+	marker.Timeline = "notifications"
+	
+	err = hc.client.SetTimelineMarkers(context.Background(), &[]mastodon.Marker{*marker})
+	return
+}
+
 func (hc *Hellclient) PrintReceivedNotification(notification *mastodon.Notification) {
 	var notifications []*mastodon.Notification
 	notifications = append(notifications, notification)
--