From 384179e518c8d01a126e716a3f80a9543683e593 Mon Sep 17 00:00:00 2001 From: r Date: Sat, 16 Jan 2021 05:46:51 +0000 Subject: Fix user info --- mastodon/accounts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mastodon') diff --git a/mastodon/accounts.go b/mastodon/accounts.go index c5eb227..694e672 100644 --- a/mastodon/accounts.go +++ b/mastodon/accounts.go @@ -60,7 +60,7 @@ func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error) { if err != nil { return nil, err } - if account.Pleroma == nil { + if account.Pleroma == nil || len(account.Pleroma.Relationship.ID) < 1 { rs, err := c.GetAccountRelationships(ctx, []string{id}) if err != nil { return nil, err -- cgit v1.2.3 From ac342dde079a0ca156c36a402a3c0ba86d78821d Mon Sep 17 00:00:00 2001 From: r Date: Sat, 23 Jan 2021 08:44:05 +0000 Subject: Add remote timeline --- mastodon/status.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mastodon') diff --git a/mastodon/status.go b/mastodon/status.go index c8555d6..80e7e0e 100644 --- a/mastodon/status.go +++ b/mastodon/status.go @@ -191,9 +191,11 @@ func (c *Client) GetTimelineHome(ctx context.Context, pg *Pagination) ([]*Status } // GetTimelinePublic return statuses from public timeline. -func (c *Client) GetTimelinePublic(ctx context.Context, isLocal bool, pg *Pagination) ([]*Status, error) { +func (c *Client) GetTimelinePublic(ctx context.Context, isLocal bool, instance string, pg *Pagination) ([]*Status, error) { params := url.Values{} - if isLocal { + if len(instance) > 0 { + params.Set("instance", instance) + } else if isLocal { params.Set("local", "true") } -- cgit v1.2.3 From 3ac95ab3b117ee8867a30c8e4b30ab37411e5ccf Mon Sep 17 00:00:00 2001 From: r Date: Sat, 23 Jan 2021 09:07:22 +0000 Subject: Use attachment file name as description Pleroma 2 no longer does it automatically. --- mastodon/mastodon.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mastodon') diff --git a/mastodon/mastodon.go b/mastodon/mastodon.go index 658b09b..8678314 100644 --- a/mastodon/mastodon.go +++ b/mastodon/mastodon.go @@ -91,7 +91,12 @@ func (c *Client) doAPI(ctx context.Context, method string, uri string, params in var buf bytes.Buffer mw := multipart.NewWriter(&buf) - part, err := mw.CreateFormFile("file", filepath.Base(file.Filename)) + fname := filepath.Base(file.Filename) + err = mw.WriteField("description", fname) + if err != nil { + return err + } + part, err := mw.CreateFormFile("file", fname) if err != nil { return err } -- cgit v1.2.3