瀏覽代碼

Changes reload methods to private

master
hristoterezov 9 年之前
父節點
當前提交
5d1ac53aa8
共有 3 個檔案被更改,包括 10 行新增10 行删除
  1. 3
    3
      JitsiConference.js
  2. 2
    2
      JitsiConferenceEventManager.js
  3. 5
    5
      JitsiConnection.js

+ 3
- 3
JitsiConference.js 查看文件

101
  * Reloads the conference
101
  * Reloads the conference
102
  * @param options {object} options to be overriden
102
  * @param options {object} options to be overriden
103
  */
103
  */
104
-JitsiConference.prototype.reload = function (options) {
104
+JitsiConference.prototype._reload = function (options) {
105
     var roomState = this.room.exportState();
105
     var roomState = this.room.exportState();
106
     if(!options)
106
     if(!options)
107
         options = {};
107
         options = {};
108
     options.roomState = roomState;
108
     options.roomState = roomState;
109
     this.leave(true);
109
     this.leave(true);
110
-    this.reinitialize(options);
110
+    this._reinitialize(options);
111
 }
111
 }
112
 
112
 
113
 /**
113
 /**
114
  * Reinitializes JitsiConference instance
114
  * Reinitializes JitsiConference instance
115
  * @param options {object} options to be overriden
115
  * @param options {object} options to be overriden
116
  */
116
  */
117
-JitsiConference.prototype.reinitialize = function (options) {
117
+JitsiConference.prototype._reinitialize = function (options) {
118
     this._init(options || {});
118
     this._init(options || {});
119
     this.eventManager.setupChatRoomListeners();
119
     this.eventManager.setupChatRoomListeners();
120
     this.eventManager.setupStatisticsListeners();
120
     this.eventManager.setupStatisticsListeners();

+ 2
- 2
JitsiConferenceEventManager.js 查看文件

132
 
132
 
133
     conference.room.addListener(XMPPEvents.FOCUS_LEFT,
133
     conference.room.addListener(XMPPEvents.FOCUS_LEFT,
134
         function () {
134
         function () {
135
-            if(!conference.connection.reload())
135
+            if(!conference.connection._reload())
136
                 conference.eventEmitter.emit(
136
                 conference.eventEmitter.emit(
137
                     JitsiConferenceEvents.CONFERENCE_FAILED,
137
                     JitsiConferenceEvents.CONFERENCE_FAILED,
138
                     JitsiConferenceErrors.FOCUS_LEFT);
138
                     JitsiConferenceErrors.FOCUS_LEFT);
140
 
140
 
141
     conference.room.addListener(XMPPEvents.ALLOCATE_FOCUS_MAX_RETRIES_ERROR,
141
     conference.room.addListener(XMPPEvents.ALLOCATE_FOCUS_MAX_RETRIES_ERROR,
142
         function () {
142
         function () {
143
-            conference.connection.reload();
143
+            conference.connection._reload();
144
         });
144
         });
145
 
145
 
146
     this.chatRoomForwarder.forward(XMPPEvents.CONNECTION_INTERRUPTED,
146
     this.chatRoomForwarder.forward(XMPPEvents.CONNECTION_INTERRUPTED,

+ 5
- 5
JitsiConnection.js 查看文件

28
             if(errType === JitsiConnectionErrors.OTHER_ERROR &&
28
             if(errType === JitsiConnectionErrors.OTHER_ERROR &&
29
                 (msg === "item-not-found" || msg === "host-unknown")) {
29
                 (msg === "item-not-found" || msg === "host-unknown")) {
30
                     // FIXME: don't report the error if we are going to reload
30
                     // FIXME: don't report the error if we are going to reload
31
-                    this.reload();
31
+                    this._reload();
32
                 }
32
                 }
33
         }.bind(this));
33
         }.bind(this));
34
 }
34
 }
60
  * Reloads the JitsiConnection instance and all related conferences
60
  * Reloads the JitsiConnection instance and all related conferences
61
  * @param options {object} options to be overriden
61
  * @param options {object} options to be overriden
62
  */
62
  */
63
-JitsiConnection.prototype.reload = function (options) {
63
+JitsiConnection.prototype._reload = function (options) {
64
     if(this.retryOnFail === 0)
64
     if(this.retryOnFail === 0)
65
         return false;
65
         return false;
66
     this.retryOnFail--;
66
     this.retryOnFail--;
70
         this.conferences[name].leave(true);
70
         this.conferences[name].leave(true);
71
     }
71
     }
72
     this.connectionEstablishedHandler =
72
     this.connectionEstablishedHandler =
73
-        this.reloadConferences.bind(this, states);
73
+        this._reloadConferences.bind(this, states);
74
     this.addEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
74
     this.addEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
75
         this.connectionEstablishedHandler);
75
         this.connectionEstablishedHandler);
76
     this.xmpp.reload(options || {});
76
     this.xmpp.reload(options || {});
81
  * Reloads all conferences related to this JitsiConnection instance
81
  * Reloads all conferences related to this JitsiConnection instance
82
  * @param states {object} the exported states per conference
82
  * @param states {object} the exported states per conference
83
  */
83
  */
84
-JitsiConnection.prototype.reloadConferences = function (states) {
84
+JitsiConnection.prototype._reloadConferences = function (states) {
85
     this.removeEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
85
     this.removeEventListener(JitsiConnectionEvents.CONNECTION_ESTABLISHED,
86
         this.connectionEstablishedHandler);
86
         this.connectionEstablishedHandler);
87
     this.connectionEstablishedHandler = null;
87
     this.connectionEstablishedHandler = null;
88
     states = states || {};
88
     states = states || {};
89
     for(var name in this.conferences) {
89
     for(var name in this.conferences) {
90
-        this.conferences[name].reinitialize({connection: this,
90
+        this.conferences[name]._reinitialize({connection: this,
91
             roomState: states[name]});
91
             roomState: states[name]});
92
     }
92
     }
93
 }
93
 }

Loading…
取消
儲存