Changes
6 changed files (+38/-6)
-
-
@@ -153,7 +153,7 @@ type Activity struct {Duration time.Duration `jsonld:"duration,omitempty"` // Describes one or more entities that either performed or are expected to perform the activity. // Any single activity can have multiple actors. The actor may be specified using an indirect Link. Actor Actor `jsonld:"actor,omitempty"` Actor ObjectOrLink `jsonld:"actor,omitempty"` // Describes the indirect object, or target, of the activity. // The precise meaning of the target is largely dependent on the type of action being described // but will often be the object of the English preposition "to".
-
-
-
@@ -43,12 +43,13 @@ func CreateActivityNew(id ObjectID, a ObjectOrLink, o ObjectOrLink) CreateActiviact.Actor = Actor(serv) } if !ok { act.Actor, ok = a.(Actor) actor, _ := a.(Actor) act.Actor = actor } } act.Actor.Inbox = InboxNew() act.Actor.Inbox.Append(o) aa := act.Actor.(*Actor) aa.Inbox = InboxNew() aa.Inbox.Append(o) c := CreateActivity{ Activity: act,
-
-
-
@@ -397,6 +397,9 @@ func recipientsDeduplication(recArgs ...*ObjectsArr) error {} } if save { if rec == nil { continue } recIds = append(recIds, *rec.GetID()) } }
-
-
-
@@ -0,0 +1,12 @@{ "type": "Create", "actor": "https://littr.git/api/accounts/anonymous", "object": { "type": "Note", "attributedTo": "https://littr.git/api/accounts/anonymous", "inReplyTo": "http://littr.git/api/accounts/system/outbox/7ca154ff", "content": "<p>Hello world</p>", "to": "https://www.w3.org/ns/activitystreams#Public" } }
-
-
-
@@ -214,7 +214,7 @@ Activity being notified aboutc.RecipientsDeduplication() checkActor := func(list a.ObjectsArr, actor a.Actor) error { checkActor := func(list a.ObjectsArr, actor a.ObjectOrLink) error { for _, rec := range list { if rec.GetID() == actor.GetID() { return fmt.Errorf("%T[%s] Actor of activity should not be in the recipients list", rec, *actor.GetID())
-
-
-
@@ -324,6 +324,22 @@ var allTests = tests{a.LangRef("ro"): "Ana are mere", }, }, "create_activity_simple": { path: "./mocks/create_activity_simple.json", expected: true, blank: &a.Create{}, result: &a.Create{ Type: a.CreateType, Actor: a.IRI("https://littr.git/api/accounts/anonymous"), Object: &a.Object{ Type: a.NoteType, AttributedTo: a.IRI("https://littr.git/api/accounts/anonymous"), InReplyTo: a.IRI("http://littr.git/api/accounts/system/outbox/7ca154ff"), Content: a.NaturalLanguageValue{a.NilLangRef: "<p>Hello world</p>"}, To: a.ObjectsArr{a.IRI("https://www.w3.org/ns/activitystreams#Public")}, }, }, }, } func getFileContents(path string) ([]byte, error) {
-