[telepathy-butterfly/master] Ignore call to connection.Connect() when connect{ed, ing} as per spec

Olivier Le Thanh Duong olivier at lethanh.be
Fri Oct 16 09:38:10 PDT 2009


---
 butterfly/connection.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/butterfly/connection.py b/butterfly/connection.py
index ea3d183..6fd4903 100644
--- a/butterfly/connection.py
+++ b/butterfly/connection.py
@@ -130,9 +130,10 @@ class ButterflyConnection(telepathy.server.Connection,
         return self._handles[handle_type, handle_id]
 
     def Connect(self):
-        logger.info("Connecting")
-        self.__disconnect_reason = telepathy.CONNECTION_STATUS_REASON_NONE_SPECIFIED
-        self._msn_client.login(*self._account)
+        if self._status == telepathy.CONNECTION_STATUS_DISCONNECTED:
+            logger.info("Connecting")
+            self.__disconnect_reason = telepathy.CONNECTION_STATUS_REASON_NONE_SPECIFIED
+            self._msn_client.login(*self._account)
 
     def Disconnect(self):
         logger.info("Disconnecting")
-- 
1.5.6.5



More information about the telepathy-commits mailing list