diff options
author | Lance Stout <lancestout@gmail.com> | 2010-07-19 19:19:33 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-07-19 19:19:33 -0400 |
commit | b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865 (patch) | |
tree | 71eefc54a8c1d9586b1e4fb61ebb4b9d46bc2015 /sleekxmpp/plugins/xep_0050.py | |
parent | fec8578cf61696d8ca85a6fe85a55be71d7109fd (diff) | |
download | slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.tar.gz slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.tar.bz2 slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.tar.xz slixmpp-b5a14a0190f6ea45bfbc0e18a7ff6c61b6415865.zip |
Can now pass a name to add_handler so that the handler can be reliably removed later.
Updated uses of add_handler to include a name.
Diffstat (limited to 'sleekxmpp/plugins/xep_0050.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0050.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sleekxmpp/plugins/xep_0050.py b/sleekxmpp/plugins/xep_0050.py index 2f356e17..11a17728 100644 --- a/sleekxmpp/plugins/xep_0050.py +++ b/sleekxmpp/plugins/xep_0050.py @@ -32,11 +32,11 @@ class xep_0050(base.base_plugin): def plugin_init(self): self.xep = '0050' self.description = 'Ad-Hoc Commands' - self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='__None__'/></iq>" % self.xmpp.default_ns, self.handler_command) - self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='execute'/></iq>" % self.xmpp.default_ns, self.handler_command) - self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='next'/></iq>" % self.xmpp.default_ns, self.handler_command_next, threaded=True) - self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='cancel'/></iq>" % self.xmpp.default_ns, self.handler_command_cancel) - self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='complete'/></iq>" % self.xmpp.default_ns, self.handler_command_complete) + self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='__None__'/></iq>" % self.xmpp.default_ns, self.handler_command, name='Ad-Hoc None') + self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='execute'/></iq>" % self.xmpp.default_ns, self.handler_command, name='Ad-Hoc Execute') + self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='next'/></iq>" % self.xmpp.default_ns, self.handler_command_next, name='Ad-Hoc Next', threaded=True) + self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='cancel'/></iq>" % self.xmpp.default_ns, self.handler_command_cancel, name='Ad-Hoc Cancel') + self.xmpp.add_handler("<iq type='set' xmlns='%s'><command xmlns='http://jabber.org/protocol/commands' action='complete'/></iq>" % self.xmpp.default_ns, self.handler_command_complete, name='Ad-Hoc Complete') self.commands = {} self.sessions = {} self.sd = self.xmpp.plugin['xep_0030'] |