Browse Source

Removes reload code.

dev1
damencho 9 years ago
parent
commit
fa733cb2f6
3 changed files with 4 additions and 67 deletions
  1. 0
    14
      JitsiConference.js
  2. 4
    5
      JitsiConferenceEventManager.js
  3. 0
    48
      JitsiConnection.js

+ 0
- 14
JitsiConference.js View File

@@ -109,20 +109,6 @@ JitsiConference.prototype._init = function (options) {
109 109
     this.eventManager.setupStatisticsListeners();
110 110
 }
111 111
 
112
-/**
113
- * Reloads the conference
114
- * @param options {object} options to be overriden
115
- */
116
-JitsiConference.prototype._reload = function (options) {
117
-    var roomState = this.room.exportState();
118
-    if(!options)
119
-        options = {};
120
-    options.roomState = roomState;
121
-    this.leave(true);
122
-    this._init(options);
123
-    this.join();
124
-}
125
-
126 112
 /**
127 113
  * Joins the conference.
128 114
  * @param password {string} the password

+ 4
- 5
JitsiConferenceEventManager.js View File

@@ -171,14 +171,13 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function () {
171 171
     chatRoom.addListener(XMPPEvents.FOCUS_LEFT,
172 172
         function () {
173 173
             Statistics.analytics.sendEvent('conference.focusLeft');
174
-            if(!conference.connection._reload("focusLeft"))
175
-                conference.eventEmitter.emit(
176
-                    JitsiConferenceEvents.CONFERENCE_FAILED,
177
-                    JitsiConferenceErrors.FOCUS_LEFT);
174
+            conference.eventEmitter.emit(
175
+                JitsiConferenceEvents.CONFERENCE_FAILED,
176
+                JitsiConferenceErrors.FOCUS_LEFT);
178 177
         });
179 178
 
180 179
     var reloadHandler = function (reason) {
181
-        conference.connection._reload(reason);
180
+
182 181
     };
183 182
     chatRoom.addListener(
184 183
         XMPPEvents.ALLOCATE_FOCUS_MAX_RETRIES_ERROR,

+ 0
- 48
JitsiConnection.js View File

@@ -18,21 +18,10 @@ function JitsiConnection(appID, token, options) {
18 18
     this.options = options;
19 19
     this.xmpp = new XMPP(options, token);
20 20
     this.conferences = {};
21
-    this.retryOnFail = 0;
22
-    this.addEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
23
-        function () {
24
-            this.retryOnFail = 3;
25
-        }.bind(this));
26 21
 
27 22
     this.addEventListener(JitsiConnectionEvents.CONNECTION_FAILED,
28 23
         function (errType, msg) {
29 24
             Statistics.analytics.sendEvent('connection.failed.' + errType);
30
-            if(errType === JitsiConnectionErrors.OTHER_ERROR &&
31
-                (msg === "item-not-found" || msg === "host-unknown")) {
32
-                    var reason = "connectionError." + msg.replace(/-/g,"_");
33
-                    // FIXME: don't report the error if we are going to reload
34
-                    this._reload(reason);
35
-                }
36 25
         }.bind(this));
37 26
 
38 27
     this.addEventListener(JitsiConnectionEvents.CONNECTION_DISCONNECTED,
@@ -69,43 +58,6 @@ JitsiConnection.prototype.attach = function (options) {
69 58
     this.xmpp.attach(options);
70 59
 }
71 60
 
72
-/**
73
- * Reloads the JitsiConnection instance and all related conferences
74
- * @param reason {String} the reason for the reload.
75
- */
76
-JitsiConnection.prototype._reload = function (reason) {
77
-    if(this.retryOnFail === 0)
78
-        return false;
79
-    Statistics.sendReloadEvent(reason);
80
-    this.retryOnFail--;
81
-    var states = {};
82
-    for(var name in this.conferences) {
83
-        states[name] = this.conferences[name].room.exportState();
84
-        this.conferences[name].leave(true);
85
-    }
86
-    this.connectionEstablishedHandler =
87
-        this._reloadConferences.bind(this, states);
88
-    this.addEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
89
-        this.connectionEstablishedHandler);
90
-    this.xmpp.reload();
91
-    return true;
92
-}
93
-
94
-/**
95
- * Reloads all conferences related to this JitsiConnection instance
96
- * @param states {object} the exported states per conference
97
- */
98
-JitsiConnection.prototype._reloadConferences = function (states) {
99
-    this.removeEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
100
-        this.connectionEstablishedHandler);
101
-    this.connectionEstablishedHandler = null;
102
-    states = states || {};
103
-    for(var name in this.conferences) {
104
-        this.conferences[name]._init({roomState: states[name]});
105
-        this.conferences[name].join();
106
-    }
107
-}
108
-
109 61
 /**
110 62
  * Disconnect the client from the server.
111 63
  */

Loading…
Cancel
Save