summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2013-05-26 14:53:28 -0700
committerLance Stout <lancestout@gmail.com>2013-05-26 14:53:28 -0700
commit4a590d1497e332da8b85a6807ad0ba9f277e2cbe (patch)
tree3807aade295b3d775ba37e4dff49f65a59e81ce9
parent82e1508d6fbef3cf63bfa5f46a243054eeddd451 (diff)
downloadslixmpp-4a590d1497e332da8b85a6807ad0ba9f277e2cbe.tar.gz
slixmpp-4a590d1497e332da8b85a6807ad0ba9f277e2cbe.tar.bz2
slixmpp-4a590d1497e332da8b85a6807ad0ba9f277e2cbe.tar.xz
slixmpp-4a590d1497e332da8b85a6807ad0ba9f277e2cbe.zip
Simplify stream method unregistration process
-rw-r--r--sleekxmpp/plugins/xep_0095/stream_initiation.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/sleekxmpp/plugins/xep_0095/stream_initiation.py b/sleekxmpp/plugins/xep_0095/stream_initiation.py
index b72c840f..927248a5 100644
--- a/sleekxmpp/plugins/xep_0095/stream_initiation.py
+++ b/sleekxmpp/plugins/xep_0095/stream_initiation.py
@@ -73,15 +73,16 @@ class XEP_0095(BasePlugin):
pass
def register_method(self, method, plugin_name, order=50):
- self._methods[method] = plugin_name
+ self._methods[method] = (plugin_name, order)
self._methods_order.append((order, method, plugin_name))
self._methods_order.sort()
- def unregister_method(self, method, plugin_name, order):
+ def unregister_method(self, method):
if method in self._methods:
+ plugin_name, order = self._methods[method]
del self._methods[method]
- self._methods_order.remove((order, method, plugin_name))
- self._methods_order.sort()
+ self._methods_order.remove((order, method, plugin_name))
+ self._methods_order.sort()
def _handle_request(self, iq):
profile = iq['si']['profile']
@@ -173,7 +174,7 @@ class XEP_0095(BasePlugin):
if ifrom is None:
ifrom = self.xmpp.boundjid
- method_plugin = self._methods[stream['method']]
+ method_plugin = self._methods[stream['method']][0]
self.xmpp[method_plugin].api['preauthorize_sid'](ifrom, sid, jid)
self.api['del_pending'](ifrom, sid, jid)