diff src/core/sat_main.py @ 834:2d901b7fa861

core: bug fix at connection time
author souliane <souliane@mailoo.org>
date Fri, 07 Feb 2014 22:17:06 +0100
parents 1a1600491d9d
children 59d486726577
line wrap: on
line diff
--- a/src/core/sat_main.py	Fri Feb 07 17:10:24 2014 +0100
+++ b/src/core/sat_main.py	Fri Feb 07 22:17:06 2014 +0100
@@ -233,6 +233,16 @@
             info(_("already connected !"))
             return defer.succeed("None")
 
+        if profile in self.profiles:
+            # avoid the following error when self.connect() is called twice for the same profile within a short time period:
+            #   Jumping into debugger for post-mortem of exception ''SatXMPPClient' object has no attribute 'discoHandler'':
+            #   > /usr/local/lib/python2.7/dist-packages/sat/plugins/plugin_xep_0115.py(151)generateHash()
+            #   -> services = client.discoHandler.info(client.jid, client.jid, '').addCallback(generateHash_2, profile)
+            # This is a strange issue that is often happening on my system since libervia is being run as a twisted plugin.
+            # FIXME: properly find the problem an fix it
+            debug("being connected...")
+            return defer.succeed("None")
+
         def afterMemoryInit(ignore):
             """This part must be called when we have loaded individual parameters from memory"""
             try: