From cfec7879e3b3fc38956f2dce0acbbeb8a578f4c1 Mon Sep 17 00:00:00 2001 From: r Date: Sun, 9 Feb 2020 13:42:16 +0000 Subject: Add poll support Currenlty only voting is possible. --- service/service.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'service/service.go') diff --git a/service/service.go b/service/service.go index d762842..ecd0d3f 100644 --- a/service/service.go +++ b/service/service.go @@ -42,6 +42,7 @@ 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) @@ -843,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 -- cgit v1.2.3