2013-04-13 20:33:06 +00:00
|
|
|
"""
|
|
|
|
Show the exchanged IQs (useful for debugging).
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
|
|
|
|
|
|
|
Load the plugin:
|
|
|
|
|
|
|
|
.. code-block:: none
|
|
|
|
|
|
|
|
/load iq_show
|
|
|
|
|
|
|
|
"""
|
2011-11-15 00:27:42 +00:00
|
|
|
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):
|
2013-03-08 21:53:35 +00:00
|
|
|
self.api.information('%s' % iq, 'Iq')
|
2011-11-15 00:27:42 +00:00
|
|
|
|
|
|
|
def cleanup(self):
|
|
|
|
self.core.xmpp.remove_handler('Iq_show')
|