require replyto to exist (would crash otherwise anyway)
This commit is contained in:
parent
6c55840690
commit
94e45ae56f
13
activity.go
13
activity.go
|
@ -381,19 +381,6 @@ func gimmexonks(user *WhatAbout, outbox string) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func whosthere(xid string) ([]string, string) {
|
|
||||||
obj, err := GetJunk(xid)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("error getting remote xonk: %s", err)
|
|
||||||
return nil, ""
|
|
||||||
}
|
|
||||||
convoy, _ := obj.GetString("context")
|
|
||||||
if convoy == "" {
|
|
||||||
convoy, _ = obj.GetString("conversation")
|
|
||||||
}
|
|
||||||
return newphone(nil, obj), convoy
|
|
||||||
}
|
|
||||||
|
|
||||||
func newphone(a []string, obj junk.Junk) []string {
|
func newphone(a []string, obj junk.Junk) []string {
|
||||||
for _, addr := range []string{"to", "cc", "attributedTo"} {
|
for _, addr := range []string{"to", "cc", "attributedTo"} {
|
||||||
who, _ := obj.GetString(addr)
|
who, _ := obj.GetString(addr)
|
||||||
|
|
16
web.go
16
web.go
|
@ -1476,16 +1476,14 @@ func submithonk(w http.ResponseWriter, r *http.Request, isAPI bool) {
|
||||||
var convoy string
|
var convoy string
|
||||||
if rid != "" {
|
if rid != "" {
|
||||||
xonk := getxonk(userinfo.UserID, rid)
|
xonk := getxonk(userinfo.UserID, rid)
|
||||||
if xonk != nil {
|
if xonk == nil {
|
||||||
if xonk.Public {
|
http.Error(w, "replyto disappeared", http.StatusNotFound)
|
||||||
honk.Audience = append(honk.Audience, xonk.Audience...)
|
return
|
||||||
}
|
|
||||||
convoy = xonk.Convoy
|
|
||||||
} else {
|
|
||||||
xonkaud, c := whosthere(rid)
|
|
||||||
honk.Audience = append(honk.Audience, xonkaud...)
|
|
||||||
convoy = c
|
|
||||||
}
|
}
|
||||||
|
if xonk.Public {
|
||||||
|
honk.Audience = append(honk.Audience, xonk.Audience...)
|
||||||
|
}
|
||||||
|
convoy = xonk.Convoy
|
||||||
for i, a := range honk.Audience {
|
for i, a := range honk.Audience {
|
||||||
if a == thewholeworld {
|
if a == thewholeworld {
|
||||||
honk.Audience[0], honk.Audience[i] = honk.Audience[i], honk.Audience[0]
|
honk.Audience[0], honk.Audience[i] = honk.Audience[i], honk.Audience[0]
|
||||||
|
|
Loading…
Reference in New Issue