summaryrefslogtreecommitdiff
path: root/plugins/iq_show.py
blob: 77d50d6c107e52f076e12ea144aa01685e0a0eb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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')