2015-12-05 19:55:34 +00:00
|
|
|
class Sessions::Event::ChatSessionLeaveTemporary < Sessions::Event::ChatBase
|
|
|
|
|
|
|
|
def run
|
2015-12-09 13:09:37 +00:00
|
|
|
return super if super
|
2015-12-05 19:55:34 +00:00
|
|
|
return if !check_chat_session_exists
|
2018-10-09 06:17:41 +00:00
|
|
|
|
2015-12-05 19:55:34 +00:00
|
|
|
chat_session = current_chat_session
|
|
|
|
|
|
|
|
Delayed::Job.enqueue(
|
|
|
|
Observer::Chat::Leave::BackgroundJob.new(chat_session.id, @client_id, @session),
|
|
|
|
{
|
|
|
|
run_at: Time.zone.now + 0.5.minutes
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|