summaryrefslogtreecommitdiff
path: root/app/controllers/trigger_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-14 21:34:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-03-14 21:34:06 +0100
commit0b4e3dfd031b21c26f7bc9c7c05cd931950ecbd6 (patch)
treeca1e9ed8e63057e0310cf8e8c21e94dc699da64e /app/controllers/trigger_controller.rb
parent3a0ea10cdd6084a8beb235f5c1573c22a5d733f0 (diff)
Switchboard stuff
Diffstat (limited to 'app/controllers/trigger_controller.rb')
-rw-r--r--app/controllers/trigger_controller.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb
index fc0556b..a858e33 100644
--- a/app/controllers/trigger_controller.rb
+++ b/app/controllers/trigger_controller.rb
@@ -100,8 +100,11 @@ class TriggerController < ApplicationController
end
Switchboard.all.each do |switchboard|
- new_html = ActionController::Base.helpers.escape_javascript(render_to_string("switchboards/_current_user_dashboard", :layout => false, :locals => {:current_user => switchboard.user}))
- PrivatePub.publish_to("/switchboards/#{switchboard.id}", "$('.dashboard').replaceWith('#{new_html}');")
+ if sip_account.call_legs.where(:sip_account_id => switchboard.user.sip_account_ids).any? ||
+ sip_account.b_call_legs.where(:sip_account_id => switchboard.user.sip_account_ids).any?
+ new_html = ActionController::Base.helpers.escape_javascript(render_to_string("switchboards/_current_user_dashboard", :layout => false, :locals => {:current_user => switchboard.user}))
+ PrivatePub.publish_to("/switchboards/#{switchboard.id}", "$('.dashboard').replaceWith('#{new_html}');")
+ end
end
render(