Use uploaded avatar over legacy avatar when possible

This commit is contained in:
Alex Gleason 2020-03-04 22:42:29 -06:00
parent 3edd573c0c
commit e039a535d5
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

View File

@ -92,13 +92,13 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
end end
def icon def icon
return object.avatar if object.avatar?
return object.avatar_remote_url if is_gab_avatar? return object.avatar_remote_url if is_gab_avatar?
object.avatar
end end
def image def image
return object.header if object.header?
return object.header_remote_url if is_gab_header? return object.header_remote_url if is_gab_header?
object.header
end end
def public_key def public_key
@ -118,11 +118,11 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
end end
def is_gab_avatar? def is_gab_avatar?
object.avatar_remote_url&.start_with?('gab://') object.avatar_remote_url&.start_with?('gab://') or false
end end
def is_gab_header? def is_gab_header?
object.header_remote_url&.start_with?('gab://') object.header_remote_url&.start_with?('gab://') or false
end end
def manually_approves_followers def manually_approves_followers