mirror of
https://notabug.org/scuti/pleroma-comments
synced 2025-01-08 03:03:56 +05:30
fixed bug with 'true' showing up on page
This commit is contained in:
parent
173e4f5947
commit
63fed806ac
@ -3,6 +3,12 @@
|
||||
-- local https = "wget"
|
||||
local json = require("cjson")
|
||||
|
||||
function printTable(t)
|
||||
for key, value in pairs(t) do
|
||||
print(key, value)
|
||||
end
|
||||
end
|
||||
|
||||
function tokenizeString(inputString, delimiter)
|
||||
local tokens = {}
|
||||
for token in inputString:gmatch("[^" .. delimiter .. "]+") do
|
||||
@ -43,6 +49,9 @@ function get_short_date(timestamp)
|
||||
end
|
||||
|
||||
function write_comments(pleroma_posts, instance)
|
||||
if #pleroma_posts == 0 then
|
||||
return ""
|
||||
end
|
||||
local template = [[
|
||||
<article class="pleroma-comment" id="pleroma-comment$i$">
|
||||
<h3>
|
||||
@ -128,6 +137,7 @@ function Meta(meta)
|
||||
local c = write_comments(all_replies, "https://" .. host)
|
||||
meta["pleroma-comments"] = c
|
||||
meta["pleroma-comments-count"] = #c
|
||||
meta["pleroma-has-comments"] = (#c > 0)
|
||||
meta["pleroma"] = newelem
|
||||
return meta
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user