From 648daf66f2c0b1e7512e7f5d8e45d4d02248afe3 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Fri, 22 Mar 2024 18:50:43 +1100 Subject: [PATCH] Fix reply mentions --- lib/adamantium/jobs/send_web_mentions.rb | 11 ++++++----- slices/main/templates/posts/show.html.slim | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/adamantium/jobs/send_web_mentions.rb b/lib/adamantium/jobs/send_web_mentions.rb index cbbb054..0d6fac2 100644 --- a/lib/adamantium/jobs/send_web_mentions.rb +++ b/lib/adamantium/jobs/send_web_mentions.rb @@ -11,19 +11,20 @@ module Adamantium source = post_url links = link_finder.call(post_content) links.each do |target| - HTTParty.post(settings.webmention_url, { + HTTParty.post(URI(settings.webmention_url), { token: settings.webmention_token, source: source, - target: target + target: target.to_s }) end links = link_finder.call(in_reply_to) - links.each do |target| - HTTParty.post(settings.webmention_url, { + links.map do |target| + puts [target.to_s, source] + HTTParty.post(URI(settings.webmention_url), { token: settings.webmention_token, source: source, - target: target + target: target.to_s }) end end diff --git a/slices/main/templates/posts/show.html.slim b/slices/main/templates/posts/show.html.slim index fa55824..599b08e 100644 --- a/slices/main/templates/posts/show.html.slim +++ b/slices/main/templates/posts/show.html.slim @@ -21,9 +21,9 @@ article class="h-entry" div class="" em = "In reply to: " - if reply_in_context - a class="no-underline bg-pink-50 hover:bg-pink-100 dark:bg-pink-600 hover:dark:bg-pink-900 p-1 rounded" href=post.in_reply_to #{reply_in_context.display_title} + a class="u-in-reply-to no-underline bg-pink-50 hover:bg-pink-100 dark:bg-pink-600 hover:dark:bg-pink-900 p-1 rounded" href=post.in_reply_to #{reply_in_context.display_title} - else - a class="no-underline bg-pink-50 hover:bg-pink-100 dark:bg-pink-600 hover:dark:bg-pink-900 p-1 rounded" href=post.in_reply_to #{post.in_reply_to} + a class="u-in-reply-to no-underline bg-pink-50 hover:bg-pink-100 dark:bg-pink-600 hover:dark:bg-pink-900 p-1 rounded" href=post.in_reply_to #{post.in_reply_to} nav class="space-x-1 text-sm md:text-sm md:block dark:text-gray-600" - if post.location || post.photos? || post.videos? span See more: