From b4b3bfc06315cadda7ae3ab852a9387e53a50f53 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Tue, 11 Oct 2022 19:06:24 +0300 Subject: [PATCH] Admins and moderators visible in their profile --- mastodon/accounts.go | 4 +++- templates/user.tmpl | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mastodon/accounts.go b/mastodon/accounts.go index dbd0a48..6aee2e3 100644 --- a/mastodon/accounts.go +++ b/mastodon/accounts.go @@ -11,6 +11,8 @@ import ( type AccountPleroma struct { Relationship Relationship `json:"relationship"` + IsAdmin bool `json:"is_admin"` + IsModerator bool `json:"is_moderator"` } // Account hold information for mastodon account. @@ -66,7 +68,7 @@ func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error) { return nil, err } if len(rs) > 0 { - account.Pleroma = &AccountPleroma{*rs[0]} + account.Pleroma = &AccountPleroma{*rs[0], account.Pleroma.IsAdmin, account.Pleroma.IsModerator} } } return &account, nil diff --git a/templates/user.tmpl b/templates/user.tmpl index 8d77948..b5a65ca 100644 --- a/templates/user.tmpl +++ b/templates/user.tmpl @@ -20,6 +20,8 @@ {{if not .IsCurrent}}
{{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} + {{if .User.Pleroma.IsAdmin}} your dear admin - {{end}} + {{if .User.Pleroma.IsModerator}} your dear moderator - {{end}} {{if .User.Pleroma.Relationship.BlockedBy}} blocks you - {{end}} {{if .User.Pleroma.Relationship.Following}}