oops, owner field doesn't exist.

only check attributedto for collections.
This commit is contained in:
Ted Unangst 2023-06-11 00:02:05 -04:00
parent 846e9820e9
commit 7a332ead41
1 changed files with 3 additions and 2 deletions

View File

@ -1714,6 +1714,7 @@ func investigate(name string) (*SomeThing, error) {
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 @@ func somethingabout(obj junk.Junk) (*SomeThing, error) {
case "Service":
info.What = SomeActor
case "OrderedCollection":
isowned = true
fallthrough
case "Collection":
info.What = SomeCollection
@ -1737,8 +1739,7 @@ func somethingabout(obj junk.Junk) (*SomeThing, error) {
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 == "" {