From 7b6321302acd3fd50cc6ce55c8676584774cb4a9 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Wed, 10 Jul 2019 01:21:56 -0400 Subject: [PATCH] support a few more actor types --- activity.go | 15 +++++++++++++-- honk.go | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/activity.go b/activity.go index d3cdf4c..858548d 100644 --- a/activity.go +++ b/activity.go @@ -977,6 +977,17 @@ func gofish(name string) string { return "" } +func isactor(t string) bool { + switch t { + case "Person": + case "Application": + case "Service": + default: + return false + } + return true +} + func investigate(name string) string { if name == "" { return "" @@ -993,10 +1004,10 @@ func investigate(name string) string { return "" } t, _ := obj.GetString("type") - id, _ := obj.GetString("id") - if t != "Person" { + if !isactor(t) { log.Printf("it's not a person! %s", name) return "" } + id, _ := obj.GetString("id") return id } diff --git a/honk.go b/honk.go index c072338..50a74b8 100644 --- a/honk.go +++ b/honk.go @@ -438,7 +438,7 @@ func ximport(w http.ResponseWriter, r *http.Request) { user, _ := butwhatabout(u.Username) what, _ := j.GetString("type") - if what == "Person" { + if isactor(what) { outbox, _ := j.GetString("outbox") gimmexonks(user, outbox) http.Redirect(w, r, "/h?xid="+url.QueryEscape(xid), http.StatusSeeOther)