diff --git a/typer.go b/typer.go index d6b4f13..6133641 100644 --- a/typer.go +++ b/typer.go @@ -77,6 +77,7 @@ var onActor = CollectionTypes{ Following, Followers, } + func (t CollectionTypes) Contains(typ CollectionType) bool { for _, tt := range t { if strings.ToLower(string(typ)) == string(tt) { @@ -127,13 +128,13 @@ func (t CollectionType) IRI(i pub.Item) pub.IRI { }) } } + if len(iri) == 0 { iri = pub.IRI(fmt.Sprintf("%s/%s", i.GetLink(), t)) } return iri } - func getValidActivityCollection(typ string) CollectionType { t := CollectionType(typ) if validActivityCollection.Contains(t) {