aboutsummaryrefslogtreecommitdiff
path: root/service/service.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-02-08 10:49:06 +0000
committerr <r@freesoftwareextremist.com>2020-02-08 10:49:06 +0000
commit1e44d5d3d50c850505065ef16bc513a207c0656c (patch)
tree3f530fb102ff60075446c76b16bf28d97ecbad9d /service/service.go
parent9d2e24a7dedc311862f6c0b5c20e9f6eff221caf (diff)
downloadbloat-1e44d5d3d50c850505065ef16bc513a207c0656c.tar.gz
bloat-1e44d5d3d50c850505065ef16bc513a207c0656c.zip
Add account muting and blocking
Diffstat (limited to 'service/service.go')
-rw-r--r--service/service.go26
1 files changed, 25 insertions, 1 deletions
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) {