diff src/plugins/plugin_xep_0060.py @ 1282:74d558e6c9fd

plugin XEP-0060: free SatPubSubClient instance on profile disconnection
author souliane <souliane@mailoo.org>
date Fri, 09 Jan 2015 10:45:15 +0100
parents bb30bf3ae932
children f71a0fc26886
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0060.py	Fri Jan 09 10:44:37 2015 +0100
+++ b/src/plugins/plugin_xep_0060.py	Fri Jan 09 10:45:15 2015 +0100
@@ -65,6 +65,12 @@
         self.clients[profile] = SatPubSubClient(self.host, self)
         return self.clients[profile]
 
+    def profileDisconnected(self, profile):
+        try:
+            del self.clients[profile]
+        except KeyError:
+            pass
+
     def addManagedNode(self, node_name, callback):
         """Add a handler for a namespace
         @param namespace: NS of the handler (will appear in disco info)