From 3f41aa87b13c0113ab0cd3aacd23922d1285e33b Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Wed, 15 Feb 2023 07:26:52 +1100 Subject: [PATCH] Fix bug in masto photo upload --- lib/adamantium/client/mastodon.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/adamantium/client/mastodon.rb b/lib/adamantium/client/mastodon.rb index 8022b26..af9e0fc 100644 --- a/lib/adamantium/client/mastodon.rb +++ b/lib/adamantium/client/mastodon.rb @@ -18,7 +18,7 @@ module Adamantium content = if post[:name] "#{post[:name]} — #{settings.micropub_site_url}/post/#{post[:slug]}" else - post[:content] + "#{post[:content]} — #{settings.micropub_site_url}/post/#{post[:slug]}" end tags = post[:category].map { |tag| "##{tag}" }.join(" ") @@ -47,6 +47,7 @@ module Adamantium end def upload_media(photo:) + mastodon_server = settings.mastodon_server.split("@").first file = Tempfile.new(SecureRandom.uuid) file.write(URI.open(photo[:value]).read) file.rewind