diff options
author | mathieui <mathieui@mathieui.net> | 2011-11-29 00:00:47 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-11-29 00:00:47 +0100 |
commit | f92e875611c6f38cc1529c46869ac92a003d19a8 (patch) | |
tree | 70283e2a158c4e4fdbf7b67beb67f1af9df0cf6d /src/connection.py | |
parent | 4b549406cebab1ef175cb80d66169123ff762445 (diff) | |
download | poezio-f92e875611c6f38cc1529c46869ac92a003d19a8.tar.gz poezio-f92e875611c6f38cc1529c46869ac92a003d19a8.tar.bz2 poezio-f92e875611c6f38cc1529c46869ac92a003d19a8.tar.xz poezio-f92e875611c6f38cc1529c46869ac92a003d19a8.zip |
Add an XML tab (/xml_tab) to view incoming/outgoing stanzas
Fixes #2074
Diffstat (limited to 'src/connection.py')
-rw-r--r-- | src/connection.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/connection.py b/src/connection.py index ffa6590e..352a1d5b 100644 --- a/src/connection.py +++ b/src/connection.py @@ -41,6 +41,7 @@ class Connection(sleekxmpp.ClientXMPP): jid = '%s/%s' % (config.get('server', 'anon.louiz.org'), resource) password = None sleekxmpp.ClientXMPP.__init__(self, jid, password, ssl=True) + self.core = None self.auto_reconnect = False self.auto_authorize = None self.register_plugin('xep_0030') @@ -75,3 +76,15 @@ class Connection(sleekxmpp.ClientXMPP): return False self.process(threaded=True) return True + + def send_raw(self, data, now=False, reconnect=None): + """ + Overrides XMLStream.send_raw, with an event added + """ + if self.core: + self.core.outgoing_stanza(data) + sleekxmpp.ClientXMPP.send_raw(self, data, now, reconnect) + +class MatchAll(sleekxmpp.xmlstream.matcher.base.MatcherBase): + def match(self, xml): + return True |