mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-10 13:58:46 +00:00
Add unreact and reaction count; added mark self reactions as "*"
This commit is contained in:
parent
4e79142c93
commit
927bd6127c
4 changed files with 43 additions and 4 deletions
|
@ -11,8 +11,8 @@ import (
|
|||
)
|
||||
|
||||
type StatusPleroma struct {
|
||||
InReplyToAccountAcct string `json:"in_reply_to_account_acct"`
|
||||
Reactions []*ReactionsPleroma `json:"emoji_reactions"`
|
||||
InReplyToAccountAcct string `json:"in_reply_to_account_acct"`
|
||||
Reactions []*ReactionsPleroma `json:"emoji_reactions"`
|
||||
}
|
||||
|
||||
type ReactionsPleroma struct {
|
||||
|
@ -186,6 +186,15 @@ func (c *Client) PutReaction(ctx context.Context, id string, emoji string) (*Sta
|
|||
return &status, nil
|
||||
}
|
||||
|
||||
// UnReaction is unreaction on status with unicode emoji (Pleroma)
|
||||
func (c *Client) UnReaction(ctx context.Context, id string, emoji string) (*Status, error) {
|
||||
var status Status
|
||||
err := c.doAPI(ctx, http.MethodDelete, fmt.Sprintf("/api/v1/pleroma/statuses/%s/reactions/%s", id, emoji), nil, &status, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &status, nil
|
||||
}
|
||||
|
||||
// Reblog is reblog the toot of id and return status of reblog.
|
||||
func (c *Client) Reblog(ctx context.Context, id string) (*Status, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue