$title$
+$description$
+diff --git a/pleroma-comments.lua b/pleroma-comments.lua
index 2b9d0d5..c7fa0ff 100644
--- a/pleroma-comments.lua
+++ b/pleroma-comments.lua
@@ -56,10 +56,6 @@ function write_comments(pleroma_posts, instance, show_avatars)
-- user data
local user_info = ""
local result = ""
-
--- local uid = acct_data["id"]
--- local alias = acct_data["display_name"]
--- local handle = acct_data["acct"]
local vars = {
alias = acct_data["display_name"],
uid = acct_data["id"],
@@ -81,6 +77,37 @@ function write_comments(pleroma_posts, instance, show_avatars)
return result
end
+ function get_card(card, instance)
+ if card == nil or type(card) ~= "table" then
+ return ""
+ end
+ if card["provider_url"] == instance then
+ -- skip rendering a card
+ return ""
+ end
+-- print(type(card))
+ local card_template = [[
+ $description$$title$
+
$text$+ $card$ ]] local comments = {} @@ -108,7 +136,8 @@ function write_comments(pleroma_posts, instance, show_avatars) pid=pid, datetime=datetime, user=get_user(post["account"], instance, true), - text = text + text = text, + card = get_card(post["card"], instance) }) -- print(interpolated) table.insert(