Browse Source

Removes unused code after reloads removal

dev1
hristoterezov 8 years ago
parent
commit
733c968004

+ 2
- 15
JitsiConference.js View File

@@ -36,7 +36,6 @@ function JitsiConference(options) {
36 36
     }
37 37
     this.eventEmitter = new EventEmitter();
38 38
     this.settings = new Settings();
39
-    this.retries = 0;
40 39
     this.options = options;
41 40
     this.eventManager = new JitsiConferenceEventManager(this);
42 41
     this._init(options);
@@ -62,9 +61,6 @@ function JitsiConference(options) {
62 61
  * Initializes the conference object properties
63 62
  * @param options {object}
64 63
  * @param connection {JitsiConnection} overrides this.connection
65
- * @param roomState {object} the state of the ChatRoom instance received by
66
- * ChatRoom.exportState. If this property is set it will be passed to
67
- * ChatRoom.loadState
68 64
  */
69 65
 JitsiConference.prototype._init = function (options) {
70 66
     if(!options)
@@ -79,14 +75,9 @@ JitsiConference.prototype._init = function (options) {
79 75
         this.eventManager.setupXMPPListeners();
80 76
     }
81 77
 
82
-    this.retries++;
83 78
     this.room = this.xmpp.createRoom(this.options.name, this.options.config,
84
-        this.settings, (this.retries < 4 ? 3 : null));
79
+        this.settings);
85 80
 
86
-    //restore previous presence options
87
-    if(options.roomState) {
88
-        this.room.loadState(options.roomState);
89
-    }
90 81
     this.room.updateDeviceAvailability(RTC.getDeviceAvailability());
91 82
 
92 83
     if(!this.rtc) {
@@ -147,15 +138,11 @@ JitsiConference.prototype._leaveRoomAndRemoveParticipants = function () {
147 138
  * Leaves the conference.
148 139
  * @returns {Promise}
149 140
  */
150
-JitsiConference.prototype.leave = function (dontRemoveLocalTracks) {
141
+JitsiConference.prototype.leave = function () {
151 142
     var conference = this;
152 143
 
153 144
     this.statistics.stopCallStats();
154 145
     this.rtc.closeAllDataChannels();
155
-    if(dontRemoveLocalTracks) {
156
-        this._leaveRoomAndRemoveParticipants();
157
-        return  Promise.resolve();
158
-    }
159 146
 
160 147
     return Promise.all(
161 148
         conference.getLocalTracks().map(function (track) {

+ 0
- 3
JitsiConferenceEventManager.js View File

@@ -179,9 +179,6 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
179 179
     var eventLogHandler = function (reason) {
180 180
         Statistics.sendEventToAll("conference.error." + reason);
181 181
     };
182
-    chatRoom.addListener(
183
-        XMPPEvents.ALLOCATE_FOCUS_MAX_RETRIES_ERROR,
184
-        eventLogHandler.bind(null, "allocateFocusMaxRetries"));
185 182
     chatRoom.addListener(XMPPEvents.SESSION_ACCEPT_TIMEOUT,
186 183
         eventLogHandler.bind(null, "sessionAcceptTimeout"));
187 184
 

+ 2
- 28
modules/xmpp/ChatRoom.js View File

@@ -62,8 +62,7 @@ function filterNodeFromPresenceJSON(pres, nodeName){
62 62
     return res;
63 63
 }
64 64
 
65
-function ChatRoom(connection, jid, password, XMPP, options, settings,
66
-    maxRetries) {
65
+function ChatRoom(connection, jid, password, XMPP, options, settings) {
67 66
     this.eventEmitter = new EventEmitter();
68 67
     this.xmpp = XMPP;
69 68
     this.connection = connection;
@@ -80,8 +79,7 @@ function ChatRoom(connection, jid, password, XMPP, options, settings,
80 79
     this.bridgeIsDown = false;
81 80
     this.options = options || {};
82 81
     this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
83
-        settings, {connection: this.xmpp.options, conference: this.options},
84
-        maxRetries);
82
+        settings, {connection: this.xmpp.options, conference: this.options});
85 83
     this.initPresenceMap();
86 84
     this.session = null;
87 85
     var self = this;
@@ -631,30 +629,6 @@ ChatRoom.prototype.removePresenceListener = function (name) {
631 629
     delete this.presHandlers[name];
632 630
 };
633 631
 
634
-/**
635
- * Exports the current state of the ChatRoom instance.
636
- * @returns {object}
637
- */
638
-ChatRoom.prototype.exportState = function () {
639
-    return {
640
-        presHandlers: this.presHandlers,
641
-        presMapNodes: this.presMap.nodes
642
-    }
643
-}
644
-
645
-/**
646
- * Loads previously exported state object from ChatRoom instance into current
647
- * ChatRoom instance.
648
- * @param state {object} the state received by ChatRoom.exportState method.
649
- */
650
-ChatRoom.prototype.loadState = function (state) {
651
-    if(!state || !state.presHandlers || !state.presMapNodes)
652
-        throw new Error("Invalid state object passed");
653
-
654
-    this.presHandlers = state.presHandlers;
655
-    this.presMap.nodes = state.presMapNodes;
656
-}
657
-
658 632
 /**
659 633
  * Checks if the user identified by given <tt>mucJid</tt> is the conference
660 634
  * focus.

+ 1
- 3
modules/xmpp/moderator.js View File

@@ -21,7 +21,7 @@ function createExpBackoffTimer(step) {
21 21
     };
22 22
 }
23 23
 
24
-function Moderator(roomName, xmpp, emitter, settings, options, maxRetries) {
24
+function Moderator(roomName, xmpp, emitter, settings, options) {
25 25
     this.roomName = roomName;
26 26
     this.xmppService = xmpp;
27 27
     this.getNextTimeout = createExpBackoffTimer(1000);
@@ -30,8 +30,6 @@ function Moderator(roomName, xmpp, emitter, settings, options, maxRetries) {
30 30
     this.externalAuthEnabled = false;
31 31
     this.settings = settings;
32 32
     this.options = options;
33
-    this.maxRetries = maxRetries || Infinity;
34
-    this.retries = 0;
35 33
 
36 34
     // Sip gateway can be enabled by configuring Jigasi host in config.js or
37 35
     // it will be enabled automatically if focus detects the component through

+ 2
- 2
modules/xmpp/strophe.emuc.js View File

@@ -24,7 +24,7 @@ module.exports = function(XMPP) {
24 24
             this.connection.addHandler(this.onMute.bind(this),
25 25
                 'http://jitsi.org/jitmeet/audio', 'iq', 'set',null,null);
26 26
         },
27
-        createRoom: function (jid, password, options, settings, maxRetries) {
27
+        createRoom: function (jid, password, options, settings) {
28 28
             var roomJid = Strophe.getBareJidFromJid(jid);
29 29
             if (this.rooms[roomJid]) {
30 30
                 var errmsg = "You are already in the room!";
@@ -33,7 +33,7 @@ module.exports = function(XMPP) {
33 33
                 return;
34 34
             }
35 35
             this.rooms[roomJid] = new ChatRoom(this.connection, jid,
36
-                password, XMPP, options, settings, maxRetries);
36
+                password, XMPP, options, settings);
37 37
             return this.rooms[roomJid];
38 38
         },
39 39
         doLeave: function (jid) {

+ 2
- 3
modules/xmpp/xmpp.js View File

@@ -272,7 +272,7 @@ XMPP.prototype.connect = function (jid, password) {
272 272
     return this._connect(jid, password);
273 273
 };
274 274
 
275
-XMPP.prototype.createRoom = function (roomName, options, settings, maxRetries) {
275
+XMPP.prototype.createRoom = function (roomName, options, settings) {
276 276
     var roomjid = roomName  + '@' + this.options.hosts.muc;
277 277
 
278 278
     if (options.useNicks) {
@@ -292,8 +292,7 @@ XMPP.prototype.createRoom = function (roomName, options, settings, maxRetries) {
292 292
         roomjid += '/' + tmpJid;
293 293
     }
294 294
 
295
-    return this.connection.emuc.createRoom(roomjid, null, options, settings,
296
-        maxRetries);
295
+    return this.connection.emuc.createRoom(roomjid, null, options, settings);
297 296
 }
298 297
 
299 298
 XMPP.prototype.addListener = function(type, listener) {

+ 0
- 5
service/xmpp/XMPPEvents.js View File

@@ -7,11 +7,6 @@ var XMPPEvents = {
7 7
     // audio.
8 8
     AUDIO_MUTED_BY_FOCUS: "xmpp.audio_muted_by_focus",
9 9
     AUTHENTICATION_REQUIRED: "xmpp.authentication_required",
10
-    /**
11
-     * Max retries value of Moderator.allocateConferenceFocus failures is
12
-     * reached.
13
-     */
14
-    ALLOCATE_FOCUS_MAX_RETRIES_ERROR: "xmpp.allocate_focus_max_retries_error",
15 10
     BRIDGE_DOWN: "xmpp.bridge_down",
16 11
     // Designates an event indicating that an offer (e.g. Jingle
17 12
     // session-initiate) was received.

Loading…
Cancel
Save