mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-05 04:29:21 +02:00
Gracefully handle the elephant
This commit is contained in:
parent
c41f9272f9
commit
d5230852cf
|
@ -34,7 +34,7 @@ type Account struct {
|
|||
Moved *Account `json:"moved"`
|
||||
Fields []Field `json:"fields"`
|
||||
Bot bool `json:"bot"`
|
||||
Pleroma AccountPleroma `json:"pleroma"`
|
||||
Pleroma *AccountPleroma `json:"pleroma"`
|
||||
}
|
||||
|
||||
// Field is a Mastodon account profile field.
|
||||
|
@ -60,6 +60,15 @@ func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if account.Pleroma == nil {
|
||||
rs, err := c.GetAccountRelationships(ctx, []string{id})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(rs) > 0 {
|
||||
account.Pleroma = &AccountPleroma{*rs[0]}
|
||||
}
|
||||
}
|
||||
return &account, nil
|
||||
}
|
||||
|
||||
|
|
|
@ -339,6 +339,7 @@ func (svc *service) ServeThreadPage(ctx context.Context, c *model.Client,
|
|||
for i := range statuses {
|
||||
statuses[i].ShowReplies = true
|
||||
statuses[i].ReplyMap = replies
|
||||
statuses[i].ReplyNumber = i
|
||||
addToReplyMap(replies, statuses[i].InReplyToID, statuses[i].ID, i+1)
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
{{if .InReplyToID}}
|
||||
<div class="status-reply-to">
|
||||
<a class="status-reply-to-link" href="{{if not .ShowReplies}}/thread/{{.InReplyToID}}{{end}}#status-{{.InReplyToID}}">
|
||||
reply to {{.Pleroma.InReplyToAccountAcct}}
|
||||
in reply to {{if .Pleroma.InReplyToAccountAcct}}{{.Pleroma.InReplyToAccountAcct}}{{else if .ReplyNumber}}#{{.ReplyNumber}}{{else}}{{.InReplyToID}}{{end}}
|
||||
</a>
|
||||
</div>
|
||||
{{if index .ReplyMap .ID}} <span class="status-reply-info-divider"> - </span> {{end}}
|
||||
|
|
Loading…
Reference in New Issue