Fix mentions
authorr <r@freesoftwareextremist.com>
Sat, 14 Dec 2019 17:47:14 +0000 (17:47 +0000)
committerr <r@freesoftwareextremist.com>
Sat, 14 Dec 2019 17:47:14 +0000 (17:47 +0000)
service/service.go

index 8b5562d67feafbdb49621fc486c0e362450c36e5..b10a5de31b6b70400831200f82c6cd9d00af8877 100644 (file)
@@ -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 {