comparison 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
comparison
equal deleted inserted replaced
1281:1c90a913fbb9 1282:74d558e6c9fd
62 self.node_cache = Sessions(timeout=60, resettable_timeout=False) 62 self.node_cache = Sessions(timeout=60, resettable_timeout=False)
63 63
64 def getHandler(self, profile): 64 def getHandler(self, profile):
65 self.clients[profile] = SatPubSubClient(self.host, self) 65 self.clients[profile] = SatPubSubClient(self.host, self)
66 return self.clients[profile] 66 return self.clients[profile]
67
68 def profileDisconnected(self, profile):
69 try:
70 del self.clients[profile]
71 except KeyError:
72 pass
67 73
68 def addManagedNode(self, node_name, callback): 74 def addManagedNode(self, node_name, callback):
69 """Add a handler for a namespace 75 """Add a handler for a namespace
70 @param namespace: NS of the handler (will appear in disco info) 76 @param namespace: NS of the handler (will appear in disco info)
71 @param callback: method to call when the handler is found 77 @param callback: method to call when the handler is found