From f92e875611c6f38cc1529c46869ac92a003d19a8 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 29 Nov 2011 00:00:47 +0100 Subject: Add an XML tab (/xml_tab) to view incoming/outgoing stanzas Fixes #2074 --- src/connection.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/connection.py') 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 -- cgit v1.2.3