some cleanups
Ted Unangst tedu@tedunangst.com
Wed, 16 Oct 2019 02:06:53 -0400
3 files changed,
15 insertions(+),
25 deletions(-)
M
activity.go
→
activity.go
@@ -1335,16 +1335,13 @@ }
if name == "" { return nil, fmt.Errorf("no name") } - log.Printf("digging up some info on %s", name) obj, err := GetJunkFast(name) if err != nil { - log.Printf("error investigating honker: %s", err) return nil, err } t, _ := obj.GetString("type") if !isactor(t) { - log.Printf("it's not a person! %s", name) - return nil, err + return nil, fmt.Errorf("not a person") } xid, _ := obj.GetString("id") handle, _ := obj.GetString("preferredUsername")
M
honk.go
→
honk.go
@@ -90,14 +90,13 @@ return honk.Flags&flagIsSaved != 0
} type Donk struct { - FileID int64 - XID string - Name string - Desc string - URL string - Media string - Local bool - Content []byte + FileID int64 + XID string + Name string + Desc string + URL string + Media string + Local bool } type Place struct {@@ -134,12 +133,6 @@ XID string
Handle string Flavor string Combos []string -} - -type Zonker struct { - ID int64 - Name string - Wherefore string } var serverName string
M
web.go
→
web.go
@@ -99,6 +99,7 @@ } else {
userid = u.UserID switch r.URL.Path { case "/atme": + templinfo["PageName"] = "at me!" templinfo["PageName"] = "atme" honks = gethonksforme(userid) case "/events":@@ -820,7 +821,7 @@ if oonker == "" {
oonker = xonk.Honker } dt := time.Now().UTC() - bonk := Honk{ + bonk := &Honk{ UserID: userinfo.UserID, Username: userinfo.Username, What: "bonk",@@ -837,17 +838,16 @@ Whofore: 2,
Convoy: xonk.Convoy, Audience: []string{thewholeworld, oonker}, Public: true, + Format: "html", } - bonk.Format = "html" - - err = savehonk(&bonk) + err = savehonk(bonk) if err != nil { log.Printf("uh oh") return } - go honkworldwide(user, &bonk) + go honkworldwide(user, bonk) if r.FormValue("js") != "1" { templinfo := getInfo(r)@@ -860,7 +860,7 @@ }
} func sendzonkofsorts(xonk *Honk, user *WhatAbout, what string) { - zonk := Honk{ + zonk := &Honk{ What: what, XID: xonk.XID, Date: time.Now().UTC(),@@ -869,7 +869,7 @@ }
zonk.Public = !keepitquiet(zonk.Audience) log.Printf("announcing %sed honk: %s", what, xonk.XID) - go honkworldwide(user, &zonk) + go honkworldwide(user, zonk) } func zonkit(w http.ResponseWriter, r *http.Request) {