Use account mentions as default text in replies
This commit is contained in:
parent
9ba666009b
commit
2495d3389e
|
@ -28,13 +28,15 @@ type ThreadPageTemplateData struct {
|
|||
Context *mastodon.Context
|
||||
PostReply bool
|
||||
ReplyToID string
|
||||
ReplyContent string
|
||||
}
|
||||
|
||||
func NewThreadPageTemplateData(status *mastodon.Status, context *mastodon.Context, postReply bool, replyToID string) *ThreadPageTemplateData {
|
||||
func NewThreadPageTemplateData(status *mastodon.Status, context *mastodon.Context, postReply bool, replyToID string, replyContent string) *ThreadPageTemplateData {
|
||||
return &ThreadPageTemplateData{
|
||||
Status: status,
|
||||
Context: context,
|
||||
PostReply: postReply,
|
||||
ReplyToID: replyToID,
|
||||
ReplyContent: replyContent,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,7 +246,17 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma
|
|||
return
|
||||
}
|
||||
|
||||
data := renderer.NewThreadPageTemplateData(status, context, reply, id)
|
||||
var content string
|
||||
if reply {
|
||||
content += status.Account.Acct + " "
|
||||
for _, m := range status.Mentions {
|
||||
content += m.Acct + " "
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println("content", content)
|
||||
|
||||
data := renderer.NewThreadPageTemplateData(status, context, reply, id, content)
|
||||
err = svc.renderer.RenderThreadPage(ctx, client, data)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<input type="hidden" name="reply_to_id" value="{{.ReplyToID}}" />
|
||||
<label for="post-content"> Reply to {{.Status.Account.DisplayName}} </label>
|
||||
<br/>
|
||||
<textarea id="post-content" name="content" class="post-content" cols="50" rows="5"></textarea>
|
||||
<textarea id="post-content" name="content" class="post-content" cols="50" rows="5">{{.ReplyContent}}</textarea>
|
||||
<br/>
|
||||
<button type="submit"> Post </button>
|
||||
</form>
|
||||
|
|
Loading…
Reference in New Issue