oops, owner field doesn't exist. only check attributedto for collections.
Ted Unangst tedu@tedunangst.com
Sun, 11 Jun 2023 00:02:05 -0400
1 files changed,
3 insertions(+),
2 deletions(-)
jump to
M
activity.go
→
activity.go
@@ -1714,6 +1714,7 @@
func somethingabout(obj junk.Junk) (*SomeThing, error) { info := new(SomeThing) t, _ := obj.GetString("type") + isowned := false switch t { case "Person": fallthrough@@ -1726,6 +1727,7 @@ fallthrough
case "Service": info.What = SomeActor case "OrderedCollection": + isowned = true fallthrough case "Collection": info.What = SomeCollection@@ -1737,8 +1739,7 @@ info.Name, _ = obj.GetString("preferredUsername")
if info.Name == "" { info.Name, _ = obj.GetString("name") } - info.Owner, _ = obj.GetString("owner") - if info.Owner == "" { + if isowned { info.Owner, _ = obj.GetString("attributedTo") } if info.Owner == "" {