diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/activitypub/tag_manager.rb | 2 | ||||
-rw-r--r-- | app/models/media_attachment.rb | 13 |
2 files changed, 2 insertions, 13 deletions
diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index ed680d762..1523f86d4 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -15,6 +15,8 @@ class ActivityPub::TagManager def url_for(target) return target.url if target.respond_to?(:local?) && !target.local? + return unless target.respond_to?(:object_type) + case target.object_type when :person target.instance_actor? ? about_more_url(instance_actor: true) : short_account_url(target) diff --git a/app/models/media_attachment.rb b/app/models/media_attachment.rb index 31aa918b7..f45e2c9f7 100644 --- a/app/models/media_attachment.rb +++ b/app/models/media_attachment.rb @@ -184,19 +184,6 @@ class MediaAttachment < ApplicationRecord audio? || video? end - def variant?(other_file_name) - return true if file_file_name == other_file_name - return false if file_file_name.nil? - - formats = file.styles.values.map(&:format).compact - - return false if formats.empty? - - extension = File.extname(other_file_name) - - formats.include?(extension.delete('.')) && File.basename(other_file_name, extension) == File.basename(file_file_name, File.extname(file_file_name)) - end - def to_param shortcode end |