|
|
@@ -1,5 +1,5 @@
|
|
1
|
|
-/* global $, $iq, config, connection, Etherpad, hangUp, roomName, Strophe,
|
|
2
|
|
- Toolbar, Util, VideoLayout */
|
|
|
1
|
+/* global $, $iq, config, connection, Etherpad, hangUp, messageHandler,
|
|
|
2
|
+ roomName, Strophe, Toolbar, Util, VideoLayout */
|
|
3
|
3
|
/**
|
|
4
|
4
|
* Contains logic responsible for enabling/disabling functionality available
|
|
5
|
5
|
* only to moderator users.
|
|
|
@@ -78,15 +78,19 @@ var Moderator = (function (my) {
|
|
78
|
78
|
return focusUserJid;
|
|
79
|
79
|
};
|
|
80
|
80
|
|
|
81
|
|
- my.createConferenceIq = function () {
|
|
|
81
|
+ my.getFocusComponent = function () {
|
|
82
|
82
|
// Get focus component address
|
|
83
|
83
|
var focusComponent = config.hosts.focus;
|
|
84
|
84
|
// If not specified use default: 'focus.domain'
|
|
85
|
85
|
if (!focusComponent) {
|
|
86
|
86
|
focusComponent = 'focus.' + config.hosts.domain;
|
|
87
|
87
|
}
|
|
|
88
|
+ return focusComponent;
|
|
|
89
|
+ };
|
|
|
90
|
+
|
|
|
91
|
+ my.createConferenceIq = function () {
|
|
88
|
92
|
// Generate create conference IQ
|
|
89
|
|
- var elem = $iq({to: focusComponent, type: 'set'});
|
|
|
93
|
+ var elem = $iq({to: Moderator.getFocusComponent(), type: 'set'});
|
|
90
|
94
|
elem.c('conference', {
|
|
91
|
95
|
xmlns: 'http://jitsi.org/protocol/focus',
|
|
92
|
96
|
room: roomName
|
|
|
@@ -162,6 +166,11 @@ var Moderator = (function (my) {
|
|
162
|
166
|
function (error) {
|
|
163
|
167
|
var waitMs = getNextErrorTimeout();
|
|
164
|
168
|
console.error("Focus error, retry after " + waitMs, error);
|
|
|
169
|
+ // Show message
|
|
|
170
|
+ messageHandler.notify(
|
|
|
171
|
+ 'Conference focus', 'disconnected',
|
|
|
172
|
+ Moderator.getFocusComponent() +
|
|
|
173
|
+ ' not available - retry in ' + (waitMs / 1000) + ' sec');
|
|
165
|
174
|
// Reset response timeout
|
|
166
|
175
|
getNextTimeout(true);
|
|
167
|
176
|
window.setTimeout(
|