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
|
|
|
|
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
|