all repos — honk @ e3a517d624a21e54b00417a23343ffc6ff03e0a2

my fork of honk

some debug code for chatter
Ted Unangst tedu@tedunangst.com
Sun, 17 May 2020 21:26:59 -0400
commit

e3a517d624a21e54b00417a23343ffc6ff03e0a2

parent

6a23f35877106f3ed8fb743429b58bbc16c613c4

2 files changed, 19 insertions(+), 2 deletions(-)

jump to
M activity.goactivity.go

@@ -1294,7 +1294,7 @@ }

return rcpts } -func sendchonk(user *WhatAbout, ch *Chonk) { +func chonkifymsg(user *WhatAbout, ch *Chonk) []byte { dt := ch.Date.Format(time.RFC3339) aud := []string{ch.Target}

@@ -1319,7 +1319,12 @@ j["published"] = dt

j["to"] = aud j["object"] = jo - msg := j.ToBytes() + return j.ToBytes() +} + +func sendchonk(user *WhatAbout, ch *Chonk) { + msg := chonkifymsg(user, ch) + rcpts := make(map[string]bool) rcpts[ch.Target] = true for a := range rcpts {
M honk.gohonk.go

@@ -337,6 +337,18 @@ serve()

case "backend": backendServer() case "test": + xid := args[1] + chatter := loadchatter(1) + for _, chonks := range chatter { + for _, ch := range chonks { + if ch.XID == xid { + var user *WhatAbout + somenumberedusers.Get(ch.UserID, &user) + msg := chonkifymsg(user, ch) + fmt.Println(string(msg)) + } + } + } ElaborateUnitTests() default: log.Fatal("unknown command")