fix: Stop raising errors for unsupported Whatsapp messages (#5541)
- Handle unsupported Whatsapp messages
This commit is contained in:
@@ -12,7 +12,7 @@ class Whatsapp::IncomingMessageBaseService
|
||||
|
||||
set_conversation
|
||||
|
||||
return if @processed_params[:messages].blank?
|
||||
return if @processed_params[:messages].blank? || unprocessable_message_type?
|
||||
|
||||
@message = @conversation.messages.build(
|
||||
content: message_content(@processed_params[:messages].first),
|
||||
@@ -86,6 +86,10 @@ class Whatsapp::IncomingMessageBaseService
|
||||
@processed_params[:messages].first[:type]
|
||||
end
|
||||
|
||||
def unprocessable_message_type?
|
||||
%w[reaction contacts].include?(message_type)
|
||||
end
|
||||
|
||||
def attach_files
|
||||
return if %w[text button interactive].include?(message_type)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user