poezio/plugins/iq_show.py
Florent Le Coz 9c3fece96b Use slixmpp
2014-07-24 02:11:45 +02:00

17 lines
473 B
Python

"""
Show the exchanged IQs (useful for debugging).
"""
from plugin import BasePlugin
from slixmpp.xmlstream.matcher import StanzaPath
from slixmpp.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.api.information('%s' % iq, 'Iq')
def cleanup(self):
self.core.xmpp.remove_handler('Iq_show')