aboutsummaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2019-12-21 08:36:44 +0000
committerr <r@freesoftwareextremist.com>2019-12-21 08:38:42 +0000
commit39c57a6b653a269668f459414d295e812f3628a8 (patch)
tree3b00e5ec638f592699d31562675b1b1e2d5da8c7 /service
parentdf875381d4e2c9a0bd283acc3592cde6562f5e5e (diff)
downloadbloat-39c57a6b653a269668f459414d295e812f3628a8.tar.gz
bloat-39c57a6b653a269668f459414d295e812f3628a8.zip
Use a single form for new posts and replies
Diffstat (limited to 'service')
-rw-r--r--service/service.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/service/service.go b/service/service.go
index 4d74449..db7a1d7 100644
--- a/service/service.go
+++ b/service/service.go
@@ -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