don't need to fill saved inbox with boring noise

This commit is contained in:
Ted Unangst 2019-04-18 16:39:29 -04:00
parent 3962fc7cb1
commit ff0e899b7a
1 changed files with 8 additions and 7 deletions

15
honk.go
View File

@ -303,16 +303,19 @@ func inbox(w http.ResponseWriter, r *http.Request) {
fd.Close() fd.Close()
return return
} }
fd, _ := os.OpenFile("savedinbox.json", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666) what, _ := jsongetstring(j, "type")
WriteJunk(fd, j) if what == "Like" {
io.WriteString(fd, "\n") return
fd.Close() }
who, _ := jsongetstring(j, "actor") who, _ := jsongetstring(j, "actor")
if !keymatch(keyname, who) { if !keymatch(keyname, who) {
log.Printf("keyname actor mismatch: %s <> %s", keyname, who) log.Printf("keyname actor mismatch: %s <> %s", keyname, who)
return 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 { switch what {
case "Ping": case "Ping":
obj, _ := jsongetstring(j, "id") 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) db.Exec("update honkers set flavor = 'undub' where xid = ? and flavor = 'dub'", who)
} }
} }
case "Like":
break
default: default:
xonk := xonkxonk(j) xonk := xonkxonk(j)
if xonk != nil && needxonk(user, xonk) { if xonk != nil && needxonk(user, xonk) {