chore: Ability to Disable Gravatars (#5027)
fixes: #3853 - Introduced DISABLE_GRAVATAR Global Config, which will stop chatwoot from making API requests to gravatar - Cleaned up avatar-related logic and centralized it into the avatarable concern - Added specs for the missing cases - Added migration for existing installations to move the avatar to attachment, rather than making the API that results in 404.
This commit is contained in:
@@ -16,6 +16,6 @@ class Instagram::WebhooksBaseService
|
||||
)
|
||||
|
||||
@contact = @contact_inbox.contact
|
||||
ContactAvatarJob.perform_later(@contact, user['profile_pic']) if user['profile_pic']
|
||||
Avatar::AvatarFromUrlJob.perform_later(@contact, user['profile_pic']) if user['profile_pic']
|
||||
end
|
||||
end
|
||||
|
||||
@@ -45,7 +45,7 @@ class Telegram::IncomingMessageService
|
||||
return if @contact.avatar.attached?
|
||||
|
||||
avatar_url = inbox.channel.get_telegram_profile_image(params[:message][:from][:id])
|
||||
::ContactAvatarJob.perform_later(@contact, avatar_url) if avatar_url
|
||||
::Avatar::AvatarFromUrlJob.perform_later(@contact, avatar_url) if avatar_url
|
||||
end
|
||||
|
||||
def conversation_params
|
||||
|
||||
@@ -30,6 +30,6 @@ class Twitter::WebhooksBaseService
|
||||
user['id'], user['name'], additional_contact_attributes(user)
|
||||
)
|
||||
@contact = @contact_inbox.contact
|
||||
ContactAvatarJob.perform_later(@contact, user['profile_image_url']) if user['profile_image_url']
|
||||
Avatar::AvatarFromUrlJob.perform_later(@contact, user['profile_image_url']) if user['profile_image_url']
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user