Skip to content

Commit

Permalink
Support sending out activities around Persons
Browse files Browse the repository at this point in the history
  • Loading branch information
thebaer committed May 11, 2022
1 parent 0da0bca commit ab8ed5d
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions activitystreams/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,29 @@ func NewFollowActivity(actorIRI, followeeIRI string) *FollowActivity {
// Object is the primary base type for the Activity Streams vocabulary.
type Object struct {
BaseObject
Published time.Time `json:"published"`
Published time.Time `json:"published,omitempty"`
Summary *string `json:"summary,omitempty"`
InReplyTo *string `json:"inReplyTo"`
InReplyTo *string `json:"inReplyTo,omitempty"`
URL string `json:"url"`
AttributedTo string `json:"attributedTo"`
To []string `json:"to"`
AttributedTo string `json:"attributedTo,omitempty"`
To []string `json:"to,omitempty"`
CC []string `json:"cc,omitempty"`
Name string `json:"name,omitempty"`
Content string `json:"content"`
Content string `json:"content,omitempty"`
ContentMap map[string]string `json:"contentMap,omitempty"`
Tag []Tag `json:"tag"`
Tag []Tag `json:"tag,omitempty"`
Attachment []Attachment `json:"attachment,omitempty"`

// Person
Inbox string `json:"inbox,omitempty"`
Outbox string `json:"outbox,omitempty"`
Following string `json:"following,omitempty"`
Followers string `json:"followers,omitempty"`
PreferredUsername string `json:"preferredUsername,omitempty"`
Icon *Image `json:"icon,omitempty"`
PublicKey *PublicKey `json:"publicKey,omitempty"`
Endpoints *Endpoints `json:"endpoints,omitempty"`

// Extensions
// NOTE: add extensions here
}
Expand Down Expand Up @@ -150,3 +160,13 @@ func NewArticleObject() *Object {
}
return &o
}

// NewPersonObject creates a basic Person object.
func NewPersonObject() *Object {
o := Object{
BaseObject: BaseObject{
Type: "Person",
},
}
return &o
}

0 comments on commit ab8ed5d

Please sign in to comment.