From 8236f08c187aa99fac7f6b5e64efa8a11ba9b45c Mon Sep 17 00:00:00 2001 From: r Date: Sat, 14 Dec 2019 17:47:14 +0000 Subject: Fix mentions --- service/service.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/service/service.go b/service/service.go index 8b5562d..b10a5de 100644 --- a/service/service.go +++ b/service/service.go @@ -246,16 +246,23 @@ func (svc *service) ServeThreadPage(ctx context.Context, client io.Writer, c *ma return } + u, err := c.GetAccountCurrentUser(ctx) + if err != nil { + return + } + var content string if reply { - content += status.Account.Acct + " " + if u.ID != status.Account.ID { + content += "@" + status.Account.Acct + " " + } for _, m := range status.Mentions { - content += m.Acct + " " + if u.ID != m.ID { + 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 { -- cgit v1.2.3