From f1b4c45088d779c784306a0bd6994a9a646dd367 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 7 May 2019 20:55:11 -0400 Subject: [PATCH] try logging only unknown activities for a while --- activity.go | 4 ++++ honk.go | 10 +--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/activity.go b/activity.go index 05dac18..5d35213 100644 --- a/activity.go +++ b/activity.go @@ -494,6 +494,10 @@ func xonkxonk(user *WhatAbout, item interface{}) *Honk { what = "eradicate" default: log.Printf("unknown activity: %s", what) + fd, _ := os.OpenFile("savedinbox.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) + WriteJunk(fd, item.(map[string]interface{})) + io.WriteString(fd, "\n") + fd.Close() return nil } diff --git a/honk.go b/honk.go index e6ed6cc..0b81110 100644 --- a/honk.go +++ b/honk.go @@ -293,11 +293,6 @@ func inbox(w http.ResponseWriter, r *http.Request) { keyname, err = makeitworksomehowwithoutregardforkeycontinuity(keyname, r, payload) } if err != nil { - fd, _ := os.OpenFile("savedinbox.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) - io.WriteString(fd, "bad signature:\n") - WriteJunk(fd, j) - io.WriteString(fd, "\n") - fd.Close() return } } @@ -315,10 +310,6 @@ func inbox(w http.ResponseWriter, r *http.Request) { log.Printf("ignoring thumb sucker %s", who) 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() switch what { case "Ping": obj, _ := jsongetstring(j, "id") @@ -357,6 +348,7 @@ func inbox(w http.ResponseWriter, r *http.Request) { return } case "Like": + case "Announce": default: log.Printf("unknown undo: %s", what) }