From 471e73d200074cbd3a06edec5d0bb8c271665aac Mon Sep 17 00:00:00 2001 From: r Date: Fri, 30 Oct 2020 17:09:47 +0000 Subject: Avoid unnecessary API call on thread page --- service/service.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/service/service.go b/service/service.go index b418921..48aafda 100644 --- a/service/service.go +++ b/service/service.go @@ -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 + " " } -- cgit v1.2.3