Revert "Removed not longer needed checks."

This reverts commit 76a130ac96.
This commit is contained in:
Martin Edenhofer 2015-11-26 11:12:01 +01:00
parent 83baddb8b0
commit 47b38e1dfb

View file

@ -5,6 +5,7 @@ class Chat < ApplicationModel
store :preferences
def customer_state(session_id = nil)
return { state: 'chat_disabled' } if !Setting.get('chat')
# reconnect
if session_id
@ -62,6 +63,7 @@ class Chat < ApplicationModel
end
def self.agent_state(user_id)
return { state: 'chat_disabled' } if !Setting.get('chat')
assets = {}
Chat.where(active: true).each {|chat|
assets = chat.assets(assets)