mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-26 15:15:49 +00:00
JS: Correct object reference in Account.
This commit is contained in:
@@ -29,22 +29,22 @@ var Account = function (remote, account) {
|
|||||||
|
|
||||||
this.on('newListener', function (type, listener) {
|
this.on('newListener', function (type, listener) {
|
||||||
if (Account.subscribe_events.indexOf(type) !== -1) {
|
if (Account.subscribe_events.indexOf(type) !== -1) {
|
||||||
if (!this._subs && 'open' === this._remote._online_state) {
|
if (!self._subs && 'open' === self._remote._online_state) {
|
||||||
this._remote.request_subscribe()
|
self._remote.request_subscribe()
|
||||||
.accounts(this._account_id)
|
.accounts(self._account_id)
|
||||||
.request();
|
.request();
|
||||||
}
|
}
|
||||||
this._subs += 1;
|
self._subs += 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on('removeListener', function (type, listener) {
|
this.on('removeListener', function (type, listener) {
|
||||||
if (Account.subscribe_events.indexOf(type) !== -1) {
|
if (Account.subscribe_events.indexOf(type) !== -1) {
|
||||||
this._subs -= 1;
|
self._subs -= 1;
|
||||||
|
|
||||||
if (!this._subs && 'open' === this._remote._online_state) {
|
if (!self._subs && 'open' === self._remote._online_state) {
|
||||||
this._remote.request_unsubscribe()
|
self._remote.request_unsubscribe()
|
||||||
.accounts(this._account_id)
|
.accounts(self._account_id)
|
||||||
.request();
|
.request();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,8 +52,8 @@ var Account = function (remote, account) {
|
|||||||
|
|
||||||
this._remote.on('connect', function () {
|
this._remote.on('connect', function () {
|
||||||
if (self._subs) {
|
if (self._subs) {
|
||||||
this._remote.request_subscribe()
|
self._remote.request_subscribe()
|
||||||
.accounts(this._account_id)
|
.accounts(self._account_id)
|
||||||
.request();
|
.request();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user