mirror of
https://notabug.org/scuti/pleroma-comments
synced 2025-01-09 11:37:48 +05:30
include opening post in comments
This commit is contained in:
parent
4d9bb430d2
commit
05ea67e03d
@ -127,12 +127,6 @@ function combine_tables(a,b)
|
||||
return a
|
||||
end
|
||||
|
||||
function get_opening_post(host, post_id)
|
||||
local url = "https://" .. host .. "/api/v1/statuses" .. post_id
|
||||
print(url)
|
||||
local received = get(url)
|
||||
end
|
||||
|
||||
function get_url_from_pandoc_str(pandoc_str)
|
||||
local str = pandoc.utils.stringify(pandoc_str)
|
||||
-- 1 = protocol, 2 = host ...
|
||||
@ -147,6 +141,12 @@ function get_url_from_pandoc_str(pandoc_str)
|
||||
return link, host, id
|
||||
end
|
||||
|
||||
function get_status(host, post_id)
|
||||
local url = "https://" .. host .. "/api/v1/statuses/" .. post_id
|
||||
print(url)
|
||||
return get(url)
|
||||
end
|
||||
|
||||
function get_replies(host, id)
|
||||
local url = "https://" .. host .. "/api/v1/statuses/" .. id .. "/context"
|
||||
print(url)
|
||||
@ -170,12 +170,10 @@ function Meta(meta)
|
||||
table.insert(hrefs,
|
||||
{link = link, id = id}
|
||||
)
|
||||
local op = get_status(host, id)
|
||||
table.insert(all_replies, op)
|
||||
local replies = get_replies(host, id)
|
||||
if #all_replies == 0 then
|
||||
all_replies = replies
|
||||
else
|
||||
combine_tables(all_replies, replies)
|
||||
end
|
||||
combine_tables(all_replies, replies)
|
||||
end
|
||||
table.sort(all_replies,
|
||||
function(a, b)
|
||||
|
Loading…
x
Reference in New Issue
Block a user