From 1e44d5d3d50c850505065ef16bc513a207c0656c Mon Sep 17 00:00:00 2001 From: r Date: Sat, 8 Feb 2020 10:49:06 +0000 Subject: Add account muting and blocking --- service/service.go | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'service/service.go') diff --git a/service/service.go b/service/service.go index c9511f9..c05097b 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) @@ -44,6 +44,10 @@ type Service interface { UnRetweet(ctx context.Context, c *model.Client, id string) (count int64, 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) @@ -848,6 +852,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) { -- cgit v1.2.3