support a few more actor types
This commit is contained in:
parent
9c20a5c321
commit
7b6321302a
15
activity.go
15
activity.go
|
@ -977,6 +977,17 @@ func gofish(name string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isactor(t string) bool {
|
||||||
|
switch t {
|
||||||
|
case "Person":
|
||||||
|
case "Application":
|
||||||
|
case "Service":
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func investigate(name string) string {
|
func investigate(name string) string {
|
||||||
if name == "" {
|
if name == "" {
|
||||||
return ""
|
return ""
|
||||||
|
@ -993,10 +1004,10 @@ func investigate(name string) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
t, _ := obj.GetString("type")
|
t, _ := obj.GetString("type")
|
||||||
id, _ := obj.GetString("id")
|
if !isactor(t) {
|
||||||
if t != "Person" {
|
|
||||||
log.Printf("it's not a person! %s", name)
|
log.Printf("it's not a person! %s", name)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
id, _ := obj.GetString("id")
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
2
honk.go
2
honk.go
|
@ -438,7 +438,7 @@ func ximport(w http.ResponseWriter, r *http.Request) {
|
||||||
user, _ := butwhatabout(u.Username)
|
user, _ := butwhatabout(u.Username)
|
||||||
|
|
||||||
what, _ := j.GetString("type")
|
what, _ := j.GetString("type")
|
||||||
if what == "Person" {
|
if isactor(what) {
|
||||||
outbox, _ := j.GetString("outbox")
|
outbox, _ := j.GetString("outbox")
|
||||||
gimmexonks(user, outbox)
|
gimmexonks(user, outbox)
|
||||||
http.Redirect(w, r, "/h?xid="+url.QueryEscape(xid), http.StatusSeeOther)
|
http.Redirect(w, r, "/h?xid="+url.QueryEscape(xid), http.StatusSeeOther)
|
||||||
|
|
Loading…
Reference in New Issue