aboutsummaryrefslogtreecommitdiff
path: root/service/service.go
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2024-02-12 05:51:06 +0000
committerr <r@freesoftwareextremist.com>2024-02-12 05:51:06 +0000
commit6ad1c5436ae4b623143db9def4b160213456a69e (patch)
tree62cb56595a2cd5d1eb19b68df9fd2aec44368fc5 /service/service.go
parent11ea3b4d47a732fe1c6abc39ce452f899f70859f (diff)
downloadbloat-6ad1c5436ae4b623143db9def4b160213456a69e.tar.gz
bloat-6ad1c5436ae4b623143db9def4b160213456a69e.zip
Show follow request count on user page
Diffstat (limited to 'service/service.go')
-rw-r--r--service/service.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/service/service.go b/service/service.go
index 953a1b9..0245042 100644
--- a/service/service.go
+++ b/service/service.go
@@ -511,12 +511,19 @@ func (s *service) UserPage(c *client, id string, pageType string,
MinID: minID,
Limit: 20,
}
+ isCurrent := c.s.UserID == id
- user, err := c.GetAccount(c.ctx, id)
+ // Some fields like AccountSource are only available in the
+ // CurrentUser API
+ var user *mastodon.Account
+ if isCurrent {
+ user, err = c.GetAccountCurrentUser(c.ctx)
+ } else {
+ user, err = c.GetAccount(c.ctx, id)
+ }
if err != nil {
return
}
- isCurrent := c.s.UserID == user.ID
switch pageType {
case "":