mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-05 11:28:45 +00:00
Use a single form for new posts and replies
This commit is contained in:
parent
df875381d4
commit
39c57a6b65
7 changed files with 42 additions and 34 deletions
|
@ -276,10 +276,9 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma
|
|||
return
|
||||
}
|
||||
|
||||
var content string
|
||||
var replyToID string
|
||||
var replyContext *model.ReplyContext
|
||||
if reply {
|
||||
replyToID = id
|
||||
var content string
|
||||
if u.ID != status.Account.ID {
|
||||
content += "@" + status.Account.Acct + " "
|
||||
}
|
||||
|
@ -288,6 +287,11 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma
|
|||
content += "@" + status.Mentions[i].Acct + " "
|
||||
}
|
||||
}
|
||||
replyContext = &model.ReplyContext{
|
||||
InReplyToID: id,
|
||||
InReplyToName: status.Account.Acct,
|
||||
ReplyContent: content,
|
||||
}
|
||||
}
|
||||
|
||||
context, err := c.GetStatusContext(ctx, id)
|
||||
|
@ -310,7 +314,7 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma
|
|||
return
|
||||
}
|
||||
|
||||
data := renderer.NewThreadPageTemplateData(statuses, replyToID, content, replyMap, navbarData)
|
||||
data := renderer.NewThreadPageTemplateData(statuses, replyContext, replyMap, navbarData)
|
||||
err = svc.renderer.RenderThreadPage(ctx, client, data)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue