iachat/app/services/whatsapp/incoming_message_service_helpers.rb
Sojan Jose e2ccac78d2
fix: Error when unsupported Whatsapp message status (#6295)
fixes error when unsupported WhatsApp message status
2023-01-19 18:52:38 +05:30

15 lines
453 B
Ruby

module Whatsapp::IncomingMessageServiceHelpers
def file_content_type(file_type)
return :image if %w[image sticker].include?(file_type)
return :audio if %w[audio voice].include?(file_type)
return :video if ['video'].include?(file_type)
return :location if ['location'].include?(file_type)
:file
end
def unprocessable_message_type?(message_type)
%w[reaction contacts ephemeral unsupported].include?(message_type)
end
end