summaryrefslogtreecommitdiff
path: root/src/connection.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-29 00:00:47 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-01-26 10:05:32 +0100
commit4d7a11e23868c2c8dbeddc9c3dcb9c3d84ec0101 (patch)
tree70283e2a158c4e4fdbf7b67beb67f1af9df0cf6d /src/connection.py
parenta1575237fd0de77e0d623204eae2c369d8d32b2a (diff)
downloadpoezio-4d7a11e23868c2c8dbeddc9c3dcb9c3d84ec0101.tar.gz
poezio-4d7a11e23868c2c8dbeddc9c3dcb9c3d84ec0101.tar.bz2
poezio-4d7a11e23868c2c8dbeddc9c3dcb9c3d84ec0101.tar.xz
poezio-4d7a11e23868c2c8dbeddc9c3dcb9c3d84ec0101.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.py13
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