Add replies to posts

This commit is contained in:
2024-03-22 08:48:21 +11:00
parent 6a5ff26948
commit a2c11de10f
12 changed files with 55 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ require "que"
module Adamantium
module Jobs
class SendWebMentions < Que::Job
def run(post_content:, post_url:)
def run(post_content:, post_url:, in_reply_to:)
link_finder = Admin::Container["post_utilities.link_finder"]
settings = Admin::Container["settings"]
@@ -17,6 +17,15 @@ module Adamantium
target: target
})
end
links = link_finder.call(in_reply_to)
links.each do |target|
HTTParty.post(settings.webmention_url, {
token: settings.webmention_token,
source: source,
target: target
})
end
end
end
end

View File

@@ -9,6 +9,7 @@ module Adamantium
youtube.com
bsky.app
bsky.social
localhost
github.com].freeze
def call(content)