aboutsummaryrefslogtreecommitdiff
path: root/service/service.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-14 18:12:48 +0000
committerr <r@freesoftwareextremist.com>2019-12-14 18:12:48 +0000
commitea66bd539dec12ef2846c23e505593f9f9d9fac3 (patch)
tree17d40c5aaf44e87ea65e444e15e87e771ca947c0 /service/service.go
parent787a197ad8cbce572152ee41b2a411b8d145285a (diff)
downloadbloat-ea66bd539dec12ef2846c23e505593f9f9d9fac3.tar.gz
bloat-ea66bd539dec12ef2846c23e505593f9f9d9fac3.zip
Focus relevant status on like, retweet and reply
Diffstat (limited to 'service/service.go')
-rw-r--r--service/service.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/service/service.go b/service/service.go
index b10a5de..3bfb163 100644
--- a/service/service.go
+++ b/service/service.go
@@ -36,7 +36,7 @@ type Service interface {
UnLike(ctx context.Context, client io.Writer, c *mastodon.Client, id string) (err error)
Retweet(ctx context.Context, client io.Writer, c *mastodon.Client, id string) (err error)
UnRetweet(ctx context.Context, client io.Writer, c *mastodon.Client, id string) (err error)
- PostTweet(ctx context.Context, client io.Writer, c *mastodon.Client, content string, replyToID string) (err error)
+ PostTweet(ctx context.Context, client io.Writer, c *mastodon.Client, content string, replyToID string) (id string, err error)
}
type service struct {
@@ -292,11 +292,16 @@ func (svc *service) UnRetweet(ctx context.Context, client io.Writer, c *mastodon
return
}
-func (svc *service) PostTweet(ctx context.Context, client io.Writer, c *mastodon.Client, content string, replyToID string) (err error) {
+func (svc *service) PostTweet(ctx context.Context, client io.Writer, c *mastodon.Client, content string, replyToID string) (id string, err error) {
tweet := &mastodon.Toot{
Status: content,
InReplyToID: replyToID,
}
- _, err = c.PostStatus(ctx, tweet)
- return
+
+ s, err := c.PostStatus(ctx, tweet)
+ if err != nil {
+ return
+ }
+
+ return s.ID, nil
}