chore: Sidebar icons for new inboxes (#3016)

- Sidebar icons for line and telegram inboxes
- Sentry fix for contact IP lookup job
This commit is contained in:
Sojan Jose
2021-09-15 18:12:56 +05:30
committed by GitHub
parent 2396b59f11
commit a14f4ede87
8 changed files with 41 additions and 15 deletions

View File

@@ -7,14 +7,18 @@ class Integrations::Dialogflow::ProcessorService
return unless processable_message?(message)
return unless message.conversation.pending?
response = get_dialogflow_response(message.conversation.contact_inbox.source_id, message_content(message))
process_response(message, response)
content = message_content(message)
response = get_dialogflow_response(message.conversation.contact_inbox.source_id, content) if content.present?
process_response(message, response) if response.present?
end
private
def message_content(message)
return message.content_attributes['submitted_values'].first['value'] if event_name == 'message.updated'
# TODO: might needs to change this to a way that we fetch the updated value from event data instead
# cause the message.updated event could be that that the message was deleted
return message.content_attributes['submitted_values']&.dig 'value' if event_name == 'message.updated'
message.content
end