Avoid unnecessary API call on thread page
authorr <r@freesoftwareextremist.com>
Fri, 30 Oct 2020 17:09:47 +0000 (17:09 +0000)
committerr <r@freesoftwareextremist.com>
Fri, 30 Oct 2020 17:09:47 +0000 (17:09 +0000)
service/service.go

index b418921b5f61dbdb31ba74b9333ced94314badca..48aafdaafd922ff080f342c99d60bc235fdf2c60 100644 (file)
@@ -300,19 +300,14 @@ func (svc *service) ServeThreadPage(c *model.Client, id string, reply bool) (err
                return
        }
 
-       u, err := c.GetAccountCurrentUser(ctx)
-       if err != nil {
-               return
-       }
-
        if reply {
                var content string
                var visibility string
-               if u.ID != status.Account.ID {
+               if c.Session.UserID != status.Account.ID {
                        content += "@" + status.Account.Acct + " "
                }
                for i := range status.Mentions {
-                       if status.Mentions[i].ID != u.ID &&
+                       if status.Mentions[i].ID != c.Session.UserID &&
                                status.Mentions[i].ID != status.Account.ID {
                                content += "@" + status.Mentions[i].Acct + " "
                        }