2016-03-25 07:45:21 +00:00
|
|
|
class Sessions::Event::ChatSessionNotice < Sessions::Event::ChatBase
|
|
|
|
|
|
|
|
def run
|
|
|
|
return super if super
|
|
|
|
return if !check_chat_session_exists
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2016-03-25 07:45:21 +00:00
|
|
|
chat_session = current_chat_session
|
|
|
|
return if !chat_session
|
|
|
|
return if !@payload['data']['message']
|
|
|
|
|
|
|
|
message = {
|
|
|
|
event: 'chat_session_notice',
|
|
|
|
data: {
|
|
|
|
session_id: chat_session.session_id,
|
|
|
|
message: @payload['data']['message'],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
chat_session.send_to_recipients(message, @client_id)
|
|
|
|
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|