diff options
Diffstat (limited to 'service/service.go')
-rw-r--r-- | service/service.go | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/service/service.go b/service/service.go index c9511f9..ecd0d3f 100644 --- a/service/service.go +++ b/service/service.go @@ -34,7 +34,7 @@ type Service interface { ServeUserSearchPage(ctx context.Context, c *model.Client, id string, q string, offset int) (err error) ServeSettingsPage(ctx context.Context, c *model.Client) (err error) NewSession(ctx context.Context, instance string) (redirectUrl string, sessionID string, err error) - Signin(ctx context.Context, c *model.Client, sessionID string, + Signin(ctx context.Context, c *model.Client, sessionID string, code string) (token string, userID string, err error) Post(ctx context.Context, c *model.Client, content string, replyToID string, format string, visibility string, isNSFW bool, files []*multipart.FileHeader) (id string, err error) @@ -42,8 +42,13 @@ type Service interface { UnLike(ctx context.Context, c *model.Client, id string) (count int64, err error) Retweet(ctx context.Context, c *model.Client, id string) (count int64, err error) UnRetweet(ctx context.Context, c *model.Client, id string) (count int64, err error) + Vote(ctx context.Context, c *model.Client, id string, choices []string) (err error) Follow(ctx context.Context, c *model.Client, id string) (err error) UnFollow(ctx context.Context, c *model.Client, id string) (err error) + Mute(ctx context.Context, c *model.Client, id string) (err error) + UnMute(ctx context.Context, c *model.Client, id string) (err error) + Block(ctx context.Context, c *model.Client, id string) (err error) + UnBlock(ctx context.Context, c *model.Client, id string) (err error) SaveSettings(ctx context.Context, c *model.Client, settings *model.Settings) (err error) MuteConversation(ctx context.Context, c *model.Client, id string) (err error) UnMuteConversation(ctx context.Context, c *model.Client, id string) (err error) @@ -523,6 +528,7 @@ func (svc *service) ServeUserPage(ctx context.Context, c *model.Client, data := &renderer.UserData{ User: user, + IsCurrent: commonData.IsCurrentUser(user.ID), Type: pageType, Users: users, Statuses: statuses, @@ -838,6 +844,15 @@ func (svc *service) UnRetweet(ctx context.Context, c *model.Client, id string) ( return } +func (svc *service) Vote(ctx context.Context, c *model.Client, id string, + choices []string) (err error) { + _, err = c.Vote(ctx, id, choices) + if err != nil { + return + } + return +} + func (svc *service) Follow(ctx context.Context, c *model.Client, id string) (err error) { _, err = c.AccountFollow(ctx, id) return @@ -848,6 +863,26 @@ func (svc *service) UnFollow(ctx context.Context, c *model.Client, id string) (e return } +func (svc *service) Mute(ctx context.Context, c *model.Client, id string) (err error) { + _, err = c.AccountMute(ctx, id) + return +} + +func (svc *service) UnMute(ctx context.Context, c *model.Client, id string) (err error) { + _, err = c.AccountUnmute(ctx, id) + return +} + +func (svc *service) Block(ctx context.Context, c *model.Client, id string) (err error) { + _, err = c.AccountBlock(ctx, id) + return +} + +func (svc *service) UnBlock(ctx context.Context, c *model.Client, id string) (err error) { + _, err = c.AccountUnblock(ctx, id) + return +} + func (svc *service) SaveSettings(ctx context.Context, c *model.Client, settings *model.Settings) (err error) { |