Admins and moderators visible in their profile

This commit is contained in:
localhost_frssoft 2022-10-11 19:06:24 +03:00
parent fb9836a1ce
commit b4b3bfc063
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -20,6 +20,8 @@
{{if not .IsCurrent}}
<div>
<span> {{if .User.Pleroma.Relationship.FollowedBy}} follows you - {{end}} </span>
<span> {{if .User.Pleroma.IsAdmin}} your dear admin - {{end}} </span>
<span> {{if .User.Pleroma.IsModerator}} your dear moderator - {{end}} </span>
{{if .User.Pleroma.Relationship.BlockedBy}} blocks you - {{end}}
{{if .User.Pleroma.Relationship.Following}}
<form class="d-inline" action="/unfollow/{{.User.ID}}" method="post">