Commit b992c23f authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

На ConnectionStateChanged проверяем был ли пользователь в списке.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56732 954022d7-b5bf-4e40-9824-e11837661b57
parent a81b0e8e
......@@ -723,26 +723,31 @@
};
DocsCoApi.prototype._onConnectionStateChanged = function (data) {
var userStateChanged = null;
var userStateChanged = null, userId, stateChanged = false;
if (undefined !== data["state"] && this.onConnectionStateChanged) {
userStateChanged = new asc_user(data);
userId = userStateChanged.asc_getId();
if (userStateChanged.asc_getState()) {
this._participants[userStateChanged.asc_getId()] = userStateChanged;
this._participants[userId] = userStateChanged;
++this._countEditUsers;
} else {
delete this._participants[userStateChanged.asc_getId()];
stateChanged = true;
} else if (this._participants.hasOwnProperty(userId)){
delete this._participants[userId];
--this._countEditUsers;
stateChanged = true;
}
// Посылаем эвент о совместном редактировании
if (1 < this._countEditUsers)
this._onStartCoAuthoring(/*isStartEvent*/false);
else
this._onEndCoAuthoring(/*isStartEvent*/false);
if (stateChanged) {
// Посылаем эвент о совместном редактировании
if (1 < this._countEditUsers)
this._onStartCoAuthoring(/*isStartEvent*/false);
else
this._onEndCoAuthoring(/*isStartEvent*/false);
this.onParticipantsChanged(this._participants, this._countEditUsers);
this.onConnectionStateChanged(userStateChanged);
this.onParticipantsChanged(this._participants, this._countEditUsers);
this.onConnectionStateChanged(userStateChanged);
}
}
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment