mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-21 19:41:28 +00:00
EditedAt commit and for feature reactions pleroma func
This commit is contained in:
parent
7d54da6380
commit
bdf1574d40
|
@ -23,6 +23,10 @@ type CreatedAt struct {
|
|||
time.Time
|
||||
}
|
||||
|
||||
type EditedAt struct{
|
||||
time.Time
|
||||
}
|
||||
|
||||
func (t *CreatedAt) UnmarshalJSON(d []byte) error {
|
||||
// Special case to handle retweets from GNU Social
|
||||
// which returns empty string ("") in created_at
|
||||
|
@ -43,6 +47,7 @@ type Status struct {
|
|||
Reblog *Status `json:"reblog"`
|
||||
Content string `json:"content"`
|
||||
CreatedAt CreatedAt `json:"created_at"`
|
||||
EditedAt *EditedAt `json:"edited_at"`
|
||||
Emojis []Emoji `json:"emojis"`
|
||||
RepliesCount int64 `json:"replies_count"`
|
||||
ReblogsCount int64 `json:"reblogs_count"`
|
||||
|
@ -153,6 +158,17 @@ func (c *Client) GetFavouritedBy(ctx context.Context, id string, pg *Pagination)
|
|||
return accounts, nil
|
||||
}
|
||||
|
||||
// GetReactionBy returns the account list of the user who reacted the toot of id. (Pleroma)
|
||||
func (c *Client) GetReactedBy(ctx context.Context, id string, pg *Pagination) ([]*Account, error) {
|
||||
var accounts []*Account
|
||||
err := c.doAPI(ctx, http.MethodGet, fmt.Sprintf("/api/v1/pleroma/statuses/%s/reactions", id), nil, &accounts, pg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return accounts, nil
|
||||
}
|
||||
|
||||
|
||||
// Reblog is reblog the toot of id and return status of reblog.
|
||||
func (c *Client) Reblog(ctx context.Context, id string) (*Status, error) {
|
||||
var status Status
|
||||
|
|
Loading…
Reference in a new issue