From e58c67fe012aa9820a16fadd30166f2a9264eed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Qu=C3=83=C2=A8ze?= Date: Fri, 19 Apr 2013 02:16:45 +0200 Subject: [PATCH] Bug 920801 - Port chat/ changes from Instantbird to comm-central - 6 - Bio 1938 - Accounts are reconnected during shutdown, r=clokep. --- chat/components/src/imAccounts.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/chat/components/src/imAccounts.js b/chat/components/src/imAccounts.js index 98325d9948..98a0129d52 100644 --- a/chat/components/src/imAccounts.js +++ b/chat/components/src/imAccounts.js @@ -337,6 +337,12 @@ imAccount.prototype = { if (this._statusObserver) this.statusInfo.addObserver(this._statusObserver); }, + _removeStatusObserver: function() { + if (this._statusObserver) { + this.statusInfo.removeObserver(this._statusObserver); + delete this._statusObserver; + } + }, get statusInfo() this._observedStatusInfo || Services.core.globalUserStatus, reconnectAttempt: 0, @@ -611,6 +617,9 @@ imAccount.prototype = { // remove any pending reconnection timer. this._cancelReconnection(); + // Keeping a status observer could cause an immediate reconnection. + this._removeStatusObserver(); + // remove any pending autologin preference used for crash detection. this._finishedAutoLogin(); @@ -691,10 +700,7 @@ imAccount.prototype = { this.prplAccount.connect(); }, disconnect: function() { - if (this._statusObserver) { - this.statusInfo.removeObserver(this._statusObserver); - delete this._statusObserver; - } + this._removeStatusObserver(); if (!this.disconnected) this._ensurePrplAccount.disconnect(); },