From b82b99f2661c2fa40e319d7205330f523223bc1b Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 15 Nov 2011 01:27:42 +0100 Subject: Add an iq_show plugin Fixes #2075 --- plugins/iq_show.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 plugins/iq_show.py (limited to 'plugins/iq_show.py') diff --git a/plugins/iq_show.py b/plugins/iq_show.py new file mode 100644 index 00000000..bfb2105a --- /dev/null +++ b/plugins/iq_show.py @@ -0,0 +1,14 @@ +from plugin import BasePlugin +from sleekxmpp.xmlstream.matcher import StanzaPath +from sleekxmpp.xmlstream.handler import Callback + +class Plugin(BasePlugin): + def init(self): + self.core.xmpp.register_handler(Callback('Iq_show', StanzaPath('iq'), self.handle_iq)) + + def handle_iq(self, iq): + self.core.information('%s' % iq, 'Iq') + + def cleanup(self): + self.core.xmpp.remove_handler('Iq_show') + del self.handle_iq -- cgit v1.2.3