summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCastor Regex <[email protected]>2025-08-31 22:34:53 -0500
committerJeff Carr <[email protected]>2025-08-31 22:34:53 -0500
commiteba85c6b97dbbab8b9b437e557a3dd5e6de41984 (patch)
treeb1f1972adf04fb331892437306b4ea7b494d90d9
parent710693b18a88643ac75bee89695f5f286923384e (diff)
feat: dump last chat entry
-rw-r--r--dumpchat.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/dumpchat.go b/dumpchat.go
index e40a6f7..dbaa3ee 100644
--- a/dumpchat.go
+++ b/dumpchat.go
@@ -5,8 +5,14 @@ import (
"go.wit.com/log"
)
+func dumpEntry(entry *chatpb.ChatEntry) {
+ log.Printf(entry.FormatTEXT())
+}
+
func dumpchat(chat *chatpb.Chat) {
- for _, entry := range chat.GetEntries() {
- log.Printf("Entry: %s\n", entry.GetUuid())
+ entries := chat.GetEntries()
+ if len(entries) > 0 {
+ lastEntry := entries[len(entries)-1]
+ dumpEntry(lastEntry)
}
}