add subscribing and unsubscribing to threads
This commit is contained in:
7
util.lua
7
util.lua
@ -105,13 +105,16 @@ function util.split_sentences(sentences, max_sentences)
|
||||
end
|
||||
|
||||
---@return string
|
||||
function util.get_post_url(req, post_id)
|
||||
function util.get_post_url(req, post_id, hash)
|
||||
hash = hash ~= false
|
||||
local post = Posts:find({id = post_id})
|
||||
if not post then return "" end
|
||||
local thread = Threads:find({id = post.thread_id})
|
||||
if not thread then return "" end
|
||||
|
||||
return req:url_for("thread", {slug = thread.slug}, {after = post_id}) .. "#post-" .. post_id
|
||||
local url = req:url_for("thread", {slug = thread.slug}, {after = post_id})
|
||||
if not hash then return url end
|
||||
return url .. "#post-" .. post_id
|
||||
end
|
||||
|
||||
function util.infobox_message(msg)
|
||||
|
Reference in New Issue
Block a user