mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 12:08:01 +00:00
Fix: slack repeated callback event message for attached files (#4610)
This commit is contained in:
@@ -35,9 +35,9 @@ class Integrations::Slack::IncomingMessageBuilder
|
||||
|
||||
def supported_message?
|
||||
if message.present?
|
||||
SUPPORTED_MESSAGE_TYPES.include?(message[:type])
|
||||
SUPPORTED_MESSAGE_TYPES.include?(message[:type]) && !attached_file_message?
|
||||
else
|
||||
params.dig(:event, :files).any?
|
||||
params[:event][:files].any? && !attached_file_message?
|
||||
end
|
||||
end
|
||||
|
||||
@@ -135,4 +135,12 @@ class Integrations::Slack::IncomingMessageBuilder
|
||||
:file
|
||||
end
|
||||
end
|
||||
|
||||
# Ignoring the changes added here https://github.com/chatwoot/chatwoot/blob/5b5a6d89c0cf7f3148a1439d6fcd847784a79b94/lib/integrations/slack/send_on_slack_service.rb#L69
|
||||
# This make sure 'Attached File!' comment is not visible on CW dashboard.
|
||||
# This is showing because of https://github.com/chatwoot/chatwoot/pull/4494/commits/07a1c0da1e522d76e37b5f0cecdb4613389ab9b6 change.
|
||||
# As now we consider the postback message with event[:files]
|
||||
def attached_file_message?
|
||||
params[:event][:text] == 'Attached File!'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user