From a3e7e2afc0b625d4d9a84c83164ae24b2e3eb424 Mon Sep 17 00:00:00 2001 From: Asaf Gartner Date: Fri, 24 Sep 2021 03:15:29 +0300 Subject: [PATCH] Rename ThreadUnread to just Unread --- src/website/feed.go | 2 +- src/website/landing.go | 4 ++-- src/website/threads_and_posts_helper.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/website/feed.go b/src/website/feed.go index dee8f6b0..fb9d9321 100644 --- a/src/website/feed.go +++ b/src/website/feed.go @@ -293,7 +293,7 @@ func fetchAllPosts(c *RequestContext, offset int, limit int) ([]templates.PostLi &postAndStuff.Thread, &postAndStuff.Post, postAndStuff.Author, - postAndStuff.ThreadUnread, + postAndStuff.Unread, true, c.Theme, ) diff --git a/src/website/landing.go b/src/website/landing.go index badc34bc..da5f21c4 100644 --- a/src/website/landing.go +++ b/src/website/landing.go @@ -142,7 +142,7 @@ func Index(c *RequestContext) ResponseData { Url: hmnurl.BuildBlogThread(proj.Slug, projectPost.Thread.ID, projectPost.Thread.Title), User: templates.UserToTemplate(projectPost.Author, c.Theme), Date: projectPost.Post.PostDate, - Unread: projectPost.ThreadUnread, + Unread: projectPost.Unread, Content: template.HTML(content), } } else { @@ -154,7 +154,7 @@ func Index(c *RequestContext) ResponseData { &projectPost.Thread, &projectPost.Post, projectPost.Author, - projectPost.ThreadUnread, + projectPost.Unread, false, c.Theme, ), diff --git a/src/website/threads_and_posts_helper.go b/src/website/threads_and_posts_helper.go index ea657863..b1d32edc 100644 --- a/src/website/threads_and_posts_helper.go +++ b/src/website/threads_and_posts_helper.go @@ -279,7 +279,7 @@ type PostsQuery struct { type PostAndStuff struct { Project models.Project `db:"project"` Thread models.Thread `db:"thread"` - ThreadUnread bool + Unread bool Post models.Post `db:"post"` CurrentVersion models.PostVersion `db:"ver"` Author *models.User `db:"author"` // Can be nil in case of a deleted user @@ -408,7 +408,7 @@ func FetchPosts( } else if row.ForumLastReadTime != nil && row.ForumLastReadTime.After(row.Post.PostDate) { hasRead = true } - row.ThreadUnread = !hasRead + row.Unread = !hasRead if row.ReplyPost != nil && row.ReplyAuthor != nil { replyAuthorIsNotApproved := row.ReplyAuthor.Status != models.UserStatusApproved