@@ -82,7 +82,7 @@ class Integrations::Slack::IncomingMessageBuilder
|
||||
content: params[:event][:text],
|
||||
source_id: "slack_#{params[:event][:ts]}",
|
||||
private: private_note?,
|
||||
user: sender
|
||||
sender: sender
|
||||
)
|
||||
|
||||
{ status: 'success' }
|
||||
|
||||
@@ -20,10 +20,6 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
|
||||
update_reference_id
|
||||
end
|
||||
|
||||
def agent
|
||||
@agent ||= message.user
|
||||
end
|
||||
|
||||
def message_content
|
||||
private_indicator = message.private? ? 'private: ' : ''
|
||||
if conversation.identifier.present?
|
||||
@@ -38,7 +34,7 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
|
||||
end
|
||||
|
||||
def send_message
|
||||
sender = message.outgoing? ? agent : contact
|
||||
sender = message.sender
|
||||
sender_type = sender.class == Contact ? 'Contact' : 'Agent'
|
||||
|
||||
@slack_message = slack_client.chat_postMessage(
|
||||
|
||||
@@ -51,7 +51,8 @@ class Integrations::Widget::IncomingMessageBuilder
|
||||
account_id: conversation.account_id,
|
||||
inbox_id: conversation.inbox_id,
|
||||
message_type: 0,
|
||||
content: options[:content]
|
||||
content: options[:content],
|
||||
sender: contact
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -46,7 +46,7 @@ class Integrations::Widget::OutgoingMessageBuilder
|
||||
inbox_id: @conversation.inbox_id,
|
||||
message_type: 1,
|
||||
content: options[:content],
|
||||
user_id: user.id
|
||||
sender: user
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user