From 3bf1d211452a2a357bdae12c64c1a8d216239e59 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 29 Jan 2020 22:33:59 -0500 Subject: [PATCH] we aren't interested in random reactions --- web.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/web.go b/web.go index 6e7fdd5..24cb5cc 100644 --- a/web.go +++ b/web.go @@ -329,7 +329,8 @@ func inbox(w http.ResponseWriter, r *http.Request) { return } what, _ := j.GetString("type") - if what == "Like" { + obj, _ := j.GetString("object") + if what == "Like" || (what == "EmojiReaction" && originate(obj) != serverName) { return } who, _ := j.GetString("actor") @@ -361,14 +362,12 @@ func inbox(w http.ResponseWriter, r *http.Request) { switch what { case "Ping": - obj, _ := j.GetString("id") - log.Printf("ping from %s: %s", who, obj) + id, _ := j.GetString("id") + log.Printf("ping from %s: %s", who, id) pong(user, who, obj) case "Pong": - obj, _ := j.GetString("object") log.Printf("pong from %s: %s", who, obj) case "Follow": - obj, _ := j.GetString("object") if obj != user.URL { log.Printf("can't follow %s", obj) return