use 'me' instead of 'user' consistently

This commit is contained in:
2025-05-20 14:28:23 +03:00
parent 82b25946a0
commit 3bd474d7fe
9 changed files with 23 additions and 23 deletions

View File

@ -21,7 +21,7 @@ local ThreadCreateError = {
app:get("all_topics", "", function(self)
self.topic_list = db.query("select * from topics limit 25;")
self.user = util.get_logged_in_user(self) or util.TransientUser
self.me = util.get_logged_in_user_or_transient(self)
return {render = "topics.topics"}
end)
@ -32,6 +32,7 @@ app:get("topic_create", "/create", function(self)
end
self.page_title = "creating topic"
self.me = user
return {render = "topics.create"}
end)
@ -67,7 +68,7 @@ app:get("topic", "/:slug", function(self)
self.threads_list = db.query("SELECT * FROM threads WHERE topic_id = ? ORDER BY is_stickied DESC, created_at DESC", topic.id)
local user = util.get_logged_in_user_or_transient(self)
print(topic.is_locked, type(topic.is_locked))
self.user = user
self.me = user
self.ThreadCreateError = ThreadCreateError
self.thread_create_error = ThreadCreateError.OK
if user:is_logged_in_guest() then
@ -95,7 +96,7 @@ app:get("topic_edit", "/:slug/edit", function(self)
return {redirect_to = self:url_for("all_topics")}
end
self.topic = topic
self.me = user
self.page_title = "editing topic " .. topic.name
return {render = "topics.edit"}