diff options
Diffstat (limited to 'backend/notes/app.bsky.feed.post.go')
| -rw-r--r-- | backend/notes/app.bsky.feed.post.go | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/backend/notes/app.bsky.feed.post.go b/backend/notes/app.bsky.feed.post.go index 17ff5ee..1c11733 100644 --- a/backend/notes/app.bsky.feed.post.go +++ b/backend/notes/app.bsky.feed.post.go @@ -7,25 +7,6 @@ import ( "time" ) -type AppBskyFeedPostNote struct { - URI string `json:"uri"` - AuthorDID string `json:"authorDid"` - AuthorHandle string `json:"authorHandle"` - AuthorName string `json:"authorName"` - AvatarURL string `json:"avatarURL"` - Text string `json:"text"` - CreatedAt time.Time `json:"createdAt"` - ReplyTo *string `json:"replyTo,omitempty"` - Facets []Facet `json:"facets,omitempty"` -} - -type Facet struct { - ByteStart int `json:"byteStart"` - ByteEnd int `json:"byteEnd"` - Type string `json:"type"` - Value string `json:"value"` // the link destination, whether url, profile or tag -} - type AppBskyFeedPostRecord struct { URI string `json:"uri"` Value struct { @@ -51,27 +32,7 @@ type AppBskyFeedPostRecord struct { } `json:"value"` } -func (bp *AppBskyFeedPostNote) GetID() string { - return bp.URI -} - -func (bp *AppBskyFeedPostNote) GetAuthorDID() string { - return bp.AuthorDID -} - -func (bp *AppBskyFeedPostNote) GetAuthorHandle() string { - return bp.AuthorHandle -} - -func (bp *AppBskyFeedPostNote) GetTimestamp() time.Time { - return bp.CreatedAt -} - -func (bp *AppBskyFeedPostNote) GetReplyTo() *string { - return bp.ReplyTo -} - -func AppBskyFeedPostFromRecord(record AppBskyFeedPostRecord, profile *general.Profile) (*AppBskyFeedPostNote, error) { +func AppBskyFeedPostFromRecord(record AppBskyFeedPostRecord, profile *general.Profile) (*Note, error) { if record.URI == "" { return nil, fmt.Errorf("missing required field: uri") } @@ -129,7 +90,7 @@ func AppBskyFeedPostFromRecord(record AppBskyFeedPostRecord, profile *general.Pr avatarURL = "" } - return &AppBskyFeedPostNote{ + return &Note{ URI: record.URI, AuthorDID: did, AuthorHandle: handle, |
