From ff0e899b7ae9cec4f3a7167c4cb2c4ef38c96241 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Thu, 18 Apr 2019 16:39:29 -0400 Subject: [PATCH] don't need to fill saved inbox with boring noise --- honk.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/honk.go b/honk.go index 4cc0620..5a76bd9 100644 --- a/honk.go +++ b/honk.go @@ -303,16 +303,19 @@ func inbox(w http.ResponseWriter, r *http.Request) { fd.Close() return } - fd, _ := os.OpenFile("savedinbox.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) - WriteJunk(fd, j) - io.WriteString(fd, "\n") - fd.Close() + what, _ := jsongetstring(j, "type") + if what == "Like" { + return + } who, _ := jsongetstring(j, "actor") if !keymatch(keyname, who) { log.Printf("keyname actor mismatch: %s <> %s", keyname, who) return } - what, _ := jsongetstring(j, "type") + fd, _ := os.OpenFile("savedinbox.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) + WriteJunk(fd, j) + io.WriteString(fd, "\n") + fd.Close() switch what { case "Ping": obj, _ := jsongetstring(j, "id") @@ -342,8 +345,6 @@ func inbox(w http.ResponseWriter, r *http.Request) { db.Exec("update honkers set flavor = 'undub' where xid = ? and flavor = 'dub'", who) } } - case "Like": - break default: xonk := xonkxonk(j) if xonk != nil && needxonk(user, xonk) {