mirror of
https://github.com/diaspora/diaspora.git
synced 2026-01-09 15:18:11 -05:00
Include the chat front-end if chat is enabled
* add jsxc helper file
This commit is contained in:
13
app/helpers/jsxc_helper.rb
Normal file
13
app/helpers/jsxc_helper.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
module JsxcHelper
|
||||
def get_bosh_endpoint
|
||||
port = AppConfig.chat.server.bosh.port
|
||||
bind = AppConfig.chat.server.bosh.bind
|
||||
host = AppConfig.pod_uri.host
|
||||
scheme = AppConfig.pod_uri.scheme
|
||||
|
||||
unless AppConfig.chat.server.bosh.proxy?
|
||||
return "http://#{host}:#{port}#{bind}"
|
||||
end
|
||||
return "#{scheme}://#{host}#{bind}"
|
||||
end
|
||||
end
|
||||
@@ -4,6 +4,9 @@
|
||||
|
||||
- content_for :head do
|
||||
= javascript_include_tag :home
|
||||
- if AppConfig.chat.enabled?
|
||||
= javascript_include_tag :jsxc, :id => 'jsxc',
|
||||
:data => { :endpoint => get_bosh_endpoint }
|
||||
|
||||
- if current_user.getting_started?
|
||||
#welcome-to-diaspora
|
||||
|
||||
Reference in New Issue
Block a user