poezio/plugins/iq_show.py

20 lines
494 B
Python
Raw Permalink Normal View History

"""
Show the exchanged IQs (useful for debugging).
"""
from poezio.plugin import BasePlugin
2014-07-24 00:07:08 +00:00
from slixmpp.xmlstream.matcher import StanzaPath
from slixmpp.xmlstream.handler import Callback
2011-11-15 00:27:42 +00:00
2018-08-15 11:13:17 +00:00
2011-11-15 00:27:42 +00:00
class Plugin(BasePlugin):
def init(self):
2018-08-15 11:13:17 +00:00
self.core.xmpp.register_handler(
Callback('Iq_show', StanzaPath('iq'), self.handle_iq))
2011-11-15 00:27:42 +00:00
def handle_iq(self, iq):
self.api.information('%s' % iq, 'Iq')
2011-11-15 00:27:42 +00:00
def cleanup(self):
self.core.xmpp.remove_handler('Iq_show')