Changes
14 changed files (+84/-84)
-
-
@@ -769,8 +769,8 @@ func (i IntransitiveActivity) IsLink() bool {} // GetID returns the ObjectID corresponding to the IntransitiveActivity object func (i IntransitiveActivity) GetID() ObjectID { return i.ID func (i IntransitiveActivity) GetID() *ObjectID { return &i.ID } // IsObject
-
@@ -789,8 +789,8 @@ func (a Activity) IsLink() bool {} // GetID returns the ObjectID corresponding to the Activity object func (a Activity) GetID() ObjectID { return a.ID func (a Activity) GetID() *ObjectID { return &a.ID } // IsObject returns true for Activity objects
-
@@ -799,7 +799,7 @@ func (a Activity) IsObject() bool {} // GetID returns the ObjectID corresponding to the Like object func (l Like) GetID() ObjectID { func (l Like) GetID() *ObjectID { return Activity(l).GetID() }
-
@@ -819,7 +819,7 @@ func (l Like) IsLink() bool {} // GetID returns the ObjectID corresponding to the Like object func (d Dislike) GetID() ObjectID { func (d Dislike) GetID() *ObjectID { return Activity(d).GetID() }
-
-
-
@@ -623,14 +623,14 @@ func TestIntransitiveActivityRecipientsDeduplication(t *testing.T) {func TestActivity_GetID(t *testing.T) { a := ActivityNew("test", ActivityType, Person{}) if a.GetID() != "test" { if *a.GetID() != "test" { t.Errorf("%T should return an empty %T object. Received %#v", a, a, a) } } func TestActivity_GetIDGetType(t *testing.T) { a := ActivityNew("test", ActivityType, Person{}) if a.GetID() != "test" || a.GetType() != ActivityType { if *a.GetID() != "test" || a.GetType() != ActivityType { t.Errorf("%T should not return an empty %T object. Received %#v", a, a, a) } }
-
@@ -651,14 +651,14 @@ func TestActivity_IsObject(t *testing.T) {func TestIntransitiveActivity_GetLink(t *testing.T) { i := IntransitiveActivityNew("test", QuestionType) if i.GetID() != "test" { if *i.GetID() != "test" { t.Errorf("%T should return an empty %T object. Received %#v", i, i, i) } } func TestIntransitiveActivity_GetObject(t *testing.T) { i := IntransitiveActivityNew("test", QuestionType) if i.GetID() != "test" || i.GetType() != QuestionType { if *i.GetID() != "test" || i.GetType() != QuestionType { t.Errorf("%T should not return an empty %T object. Received %#v", i, i, i) } }
-
-
-
@@ -257,8 +257,8 @@ func (a Actor) IsObject() bool {} // GetID returns the ObjectID corresponding to the Actor object func (a Actor) GetID() ObjectID { return a.ID func (a Actor) GetID() *ObjectID { return &a.ID } // GetType returns the type corresponding to the Actor object
-
@@ -277,8 +277,8 @@ func (a Application) IsObject() bool {} // GetID returns the ObjectID corresponding to the Application object func (a Application) GetID() ObjectID { return a.ID func (a Application) GetID() *ObjectID { return Actor(a).GetID() } // GetType returns the type corresponding to the Application object
-
@@ -287,63 +287,63 @@ func (a Application) GetType() ActivityVocabularyType {} // IsLink validates if current Group is a Link func (a Group) IsLink() bool { return a.Type == LinkType || ValidLinkType(a.Type) func (g Group) IsLink() bool { return g.Type == LinkType || ValidLinkType(g.Type) } // IsObject validates if current Group is an Object func (a Group) IsObject() bool { return a.Type == ObjectType || ValidObjectType(a.Type) func (g Group) IsObject() bool { return g.Type == ObjectType || ValidObjectType(g.Type) } // GetID returns the ObjectID corresponding to the Group object func (a Group) GetID() ObjectID { return a.ID func (g Group) GetID() *ObjectID { return Actor(g).GetID() } // GetType returns the type corresponding to the Group object func (a Group) GetType() ActivityVocabularyType { return a.Type func (g Group) GetType() ActivityVocabularyType { return g.Type } // IsLink validates if current Organization is a Link func (a Organization) IsLink() bool { return a.Type == LinkType || ValidLinkType(a.Type) func (o Organization) IsLink() bool { return o.Type == LinkType || ValidLinkType(o.Type) } // IsObject validates if current Organization is an Object func (a Organization) IsObject() bool { return a.Type == ObjectType || ValidObjectType(a.Type) func (o Organization) IsObject() bool { return o.Type == ObjectType || ValidObjectType(o.Type) } // GetID returns the ObjectID corresponding to the Organization object func (a Organization) GetID() ObjectID { return a.ID func (o Organization) GetID() *ObjectID { return Actor(o).GetID() } // GetType returns the type corresponding to the Organization object func (a Organization) GetType() ActivityVocabularyType { return a.Type func (o Organization) GetType() ActivityVocabularyType { return o.Type } // IsLink validates if current Service is a Link func (a Service) IsLink() bool { return a.Type == LinkType || ValidLinkType(a.Type) func (s Service) IsLink() bool { return s.Type == LinkType || ValidLinkType(s.Type) } // IsObject validates if current Service is an Object func (a Service) IsObject() bool { return a.Type == ObjectType || ValidObjectType(a.Type) func (s Service) IsObject() bool { return s.Type == ObjectType || ValidObjectType(s.Type) } // GetID returns the ObjectID corresponding to the Service object func (a Service) GetID() ObjectID { return a.ID func (s Service) GetID() *ObjectID { return Actor(s).GetID() } // GetType returns the type corresponding to the Service object func (a Service) GetType() ActivityVocabularyType { return a.Type func (s Service) GetType() ActivityVocabularyType { return s.Type } // IsLink validates if current Person is a Link
-
@@ -357,8 +357,8 @@ func (p Person) IsObject() bool {} // GetID returns the ObjectID corresponding to the Person object func (p Person) GetID() ObjectID { return p.ID func (p Person) GetID() *ObjectID { return Actor(p).GetID() } // GetType returns the object type for the current Person object
-
-
-
@@ -288,8 +288,8 @@ func (c *Collection) IsLink() bool {} // GetID returns the ObjectID corresponding to the Collection object func (c *Collection) GetID() ObjectID { return c.ID func (c *Collection) GetID() *ObjectID { return &c.ID } // IsObject returns true for a Collection object
-
@@ -308,8 +308,8 @@ func (o *OrderedCollection) IsLink() bool {} // GetID returns the ObjectID corresponding to the OrderedCollection func (o *OrderedCollection) GetID() ObjectID { return o.ID func (o OrderedCollection) GetID() *ObjectID { return &o.ID } // IsObject returns true for am OrderedCollection object
-
-
-
@@ -39,7 +39,7 @@ func TestCreateActivityNewWithApplication(t *testing.T) {if now.Sub(c1.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if c1.Activity.Actor.GetID() != a.ID { if *c1.Activity.Actor.GetID() != a.ID { t.Errorf("Actor ID %q different than expected %q", c1.Activity.Actor.GetID(), a.ID) } if !reflect.DeepEqual(c1.Activity.Actor.GetID(), a.GetID()) {
-
@@ -50,7 +50,7 @@ func TestCreateActivityNewWithApplication(t *testing.T) {t.Errorf("Actor %#v\n\n different than expected\n\n %#v", c1.Activity.Actor, Actor(*a)) } */ if c1.Activity.Object.GetID() != n.ID { if *c1.Activity.Object.GetID() != n.ID { t.Errorf("GetID %q different than expected %q", c1.Activity.Object.GetID(), n.ID) } if !reflect.DeepEqual(c1.Activity.Object.GetID(), n.GetID()) {
-
@@ -83,7 +83,7 @@ func TestCreateActivityNewWithGroup(t *testing.T) {if now.Sub(c1.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if c1.Activity.Actor.GetID() != g.ID { if *c1.Activity.Actor.GetID() != g.ID { t.Errorf("Actor ID %q different than expected %q", c1.Activity.Actor.GetID(), g.ID) } if !reflect.DeepEqual(c1.Activity.Actor.GetID(), g.GetID()) {
-
@@ -94,7 +94,7 @@ func TestCreateActivityNewWithGroup(t *testing.T) {t.Errorf("Actor %#v\n\n different than expected\n\n %#v", c1.Activity.Actor, Actor(*g)) } */ if c1.Activity.Object.GetID() != n.ID { if *c1.Activity.Object.GetID() != n.ID { t.Errorf("GetID %q different than expected %q", c1.Activity.Object.GetID(), n.ID) } if !reflect.DeepEqual(c1.Activity.Object.GetID(), n.GetID()) {
-
@@ -121,7 +121,7 @@ func TestCreateActivityNewWithOrganization(t *testing.T) {if now.Sub(c1.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if c1.Activity.Actor.GetID() != o.ID { if *c1.Activity.Actor.GetID() != o.ID { t.Errorf("Actor ID %q different than expected %q", c1.Activity.Actor.GetID(), o.ID) } if !reflect.DeepEqual(c1.Activity.Actor.GetID(), o.GetID()) {
-
@@ -132,7 +132,7 @@ func TestCreateActivityNewWithOrganization(t *testing.T) {t.Errorf("Actor %#v\n\n different than expected\n\n %#v", c1.Activity.Actor, Actor(*o)) } */ if c1.Activity.Object.GetID() != n.ID { if *c1.Activity.Object.GetID() != n.ID { t.Errorf("GetID %q different than expected %q", c1.Activity.Object.GetID(), n.ID) } if !reflect.DeepEqual(c1.Activity.Object.GetID(), n.GetID()) {
-
@@ -159,7 +159,7 @@ func TestCreateActivityNewWithPerson(t *testing.T) {if now.Sub(c1.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if c1.Activity.Actor.GetID() != b.ID { if *c1.Activity.Actor.GetID() != b.ID { t.Errorf("Actor ID %q different than expected %q", c1.Activity.Actor.GetID(), b.ID) } if !reflect.DeepEqual(c1.Activity.Actor.GetID(), b.GetID()) {
-
@@ -170,7 +170,7 @@ func TestCreateActivityNewWithPerson(t *testing.T) {t.Errorf("Actor %#v\n\n different than expected\n\n %#v", c1.Activity.Actor, Actor(*b)) } */ if c1.Activity.Object.GetID() != n.ID { if *c1.Activity.Object.GetID() != n.ID { t.Errorf("GetID %q different than expected %q", c1.Activity.Object.GetID(), n.ID) } if !reflect.DeepEqual(c1.Activity.Object.GetID(), n.GetID()) {
-
@@ -197,7 +197,7 @@ func TestCreateActivityNewWithService(t *testing.T) {if now.Sub(c1.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if c1.Activity.Actor.GetID() != s.ID { if *c1.Activity.Actor.GetID() != s.ID { t.Errorf("Actor ID %q different than expected %q", c1.Activity.Actor.GetID(), s.ID) } if !reflect.DeepEqual(c1.Activity.Actor.GetID(), s.GetID()) {
-
@@ -208,7 +208,7 @@ func TestCreateActivityNewWithService(t *testing.T) {t.Errorf("Actor %#v\n\n different than expected\n\n %#v", c1.Activity.Actor, Actor(*s)) } */ if c1.Activity.Object.GetID() != n.ID { if *c1.Activity.Object.GetID() != n.ID { t.Errorf("GetID %q different than expected %q", c1.Activity.Object.GetID(), n.ID) } if !reflect.DeepEqual(c1.Activity.Object.GetID(), n.GetID()) {
-
@@ -235,7 +235,7 @@ func TestCreateActivityNewWithActor(t *testing.T) {if now.Sub(c1.Published).Round(time.Millisecond) != 0 { t.Errorf("Published time '%v' different than expected '%v'", c1.Published, now) } if c1.Activity.Actor.GetID() != a.ID { if *c1.Activity.Actor.GetID() != a.ID { t.Errorf("Actor ID %q different than expected %q", c1.Activity.Actor.GetID(), a.ID) } if !reflect.DeepEqual(c1.Activity.Actor.GetID(), a.GetID()) {
-
@@ -246,7 +246,7 @@ func TestCreateActivityNewWithActor(t *testing.T) {t.Errorf("Actor %#v\n\n different than expected\n\n %#v", c1.Activity.Actor, *a) } */ if c1.Activity.Object.GetID() != n.ID { if *c1.Activity.Object.GetID() != n.ID { t.Errorf("GetID %q different than expected %q", c1.Activity.Object.GetID(), n.ID) } if !reflect.DeepEqual(c1.Activity.Object.GetID(), n.GetID()) {
-
-
-
@@ -41,8 +41,8 @@ func (i *Inbox) Append(ob ObjectOrLink) error {} // GetID returns the ObjectID corresponding to InboxStream func (i InboxStream) GetID() ObjectID { return i.ID func (i InboxStream) GetID() *ObjectID { return OrderedCollection(i).GetID() } // GetType returns the InboxStream's type
-
@@ -61,8 +61,8 @@ func (i InboxStream) IsObject() bool {} // GetID returns the ObjectID corresponding to Inbox func (i Inbox) GetID() ObjectID { return i.ID func (i Inbox) GetID() *ObjectID { return OrderedCollection(i).GetID() } // GetType returns the Inbox's type
-
-
-
@@ -28,12 +28,12 @@ func TestInboxNew(t *testing.T) {func TestInboxStream_GetID(t *testing.T) { o := InboxStream{} if o.GetID() != "" { if *o.GetID() != "" { t.Errorf("%T should be initialized with empty %T", o, o.GetID()) } id := ObjectID("test_out_stream") o.ID = id if o.GetID() != id { if *o.GetID() != id { t.Errorf("%T should have %T as %q", o, id, id) } }
-
-
-
@@ -40,8 +40,8 @@ func (l *Liked) Append(ob ObjectOrLink) error {} // GetID returns the ObjectID corresponding to the LikedCollection func (l LikedCollection) GetID() ObjectID { return l.ID func (l LikedCollection) GetID() *ObjectID { return OrderedCollection(l).GetID() } // GetType returns the LikedCollection's type
-
@@ -60,8 +60,8 @@ func (l LikedCollection) IsObject() bool {} // GetID returns the ObjectID corresponding to the Liked func (l Liked) GetID() ObjectID { return l.ID func (l Liked) GetID() *ObjectID { return OrderedCollection(l).GetID() } // GetType returns the Liked's type
-
-
-
@@ -28,12 +28,12 @@ func TestLikedNew(t *testing.T) {func TestLikedCollection_GetID(t *testing.T) { l := LikedCollection{} if l.GetID() != "" { if *l.GetID() != "" { t.Errorf("%T should be initialized with empty %T", l, l.GetID()) } id := ObjectID("test_out_stream") l.ID = id if l.GetID() != id { if *l.GetID() != id { t.Errorf("%T should have %T as %q", l, id, id) } }
-
-
-
@@ -75,8 +75,8 @@ func (l Link) IsObject() bool {} // GetID returns the ObjectID corresponding to the Mention object func (l Link) GetID() ObjectID { return l.ID func (l Link) GetID() *ObjectID { return &l.ID } // GetType returns the Type corresponding to the Mention object
-
@@ -95,8 +95,8 @@ func (m Mention) IsObject() bool {} // GetID returns the ObjectID corresponding to the Mention object func (m Mention) GetID() ObjectID { return m.ID func (m Mention) GetID() *ObjectID { return Link(m).GetID() } // GetType returns the Type corresponding to the Mention object
-
-
-
@@ -73,7 +73,7 @@ func TestMention_IsObject(t *testing.T) {func TestMention_Object(t *testing.T) { m := MentionNew("test") if !reflect.DeepEqual(ObjectID("test"), m.GetID()) { if !reflect.DeepEqual(ObjectID("test"), *m.GetID()) { t.Errorf("%#v should be an empty object", m.GetID()) } }
-
-
-
@@ -87,7 +87,7 @@ type (// ActivityObject is a subtype of Object that describes some form of action that may happen, // is currently happening, or has already happened ActivityObject interface { GetID() ObjectID GetID() *ObjectID } // ObjectOrLink describes an object of any kind. ObjectOrLink interface {
-
@@ -341,8 +341,8 @@ func ObjectNew(id ObjectID, typ ActivityVocabularyType) *Object {} // GetID returns the ObjectID corresponding to the current object func (o Object) GetID() ObjectID { return o.ID func (o Object) GetID() *ObjectID { return &o.ID } // Link returns the Link corresponding to the current object
-
@@ -376,14 +376,14 @@ func recipientsDeduplication(recArgs ...*ObjectsArr) error {for i, rec := range *recList { save := true for _, id := range recIds { if rec.GetID() == id { if *rec.GetID() == id { // mark the element for removal toRemove = append(toRemove, i) save = false } } if save { recIds = append(recIds, rec.GetID()) recIds = append(recIds, *rec.GetID()) } }
-
-
-
@@ -39,8 +39,8 @@ func (o *Outbox) Append(ob ObjectOrLink) error {} // GetID returns the ObjectID corresponding to the OutboxStream func (o OutboxStream) GetID() ObjectID { return o.ID func (o OutboxStream) GetID() *ObjectID { return OrderedCollection(o).GetID() } // GetType returns the OutboxStream's type
-
@@ -59,8 +59,8 @@ func (o OutboxStream) IsObject() bool {} // GetID returns the ObjectID corresponding to Outbox func (o Outbox) GetID() ObjectID { return o.ID func (o Outbox) GetID() *ObjectID { return OrderedCollection(o).GetID() } // GetType returns the Outbox's type
-
-
-
@@ -28,12 +28,12 @@ func TestOutboxNew(t *testing.T) {func TestOutboxStream_GetID(t *testing.T) { o := OutboxStream{} if o.GetID() != "" { if *o.GetID() != "" { t.Errorf("%T should be initialized with empty %T", o, o.GetID()) } id := ObjectID("test_out_stream") o.ID = id if o.GetID() != id { if *o.GetID() != id { t.Errorf("%T should have %T as %q", o, id, id) } }
-