Commit a1c352f2 authored by Philipp Hörist's avatar Philipp Hörist

XMLConsole: Inject jabber:client into message, presence and iq

parent 2c4f4d1e
Pipeline #4239 passed with stages
in 2 minutes and 39 seconds
......@@ -172,10 +172,18 @@ class XMLConsoleWindow(Gtk.ApplicationWindow):
stanza = buffer_.get_text(begin_iter, end_iter, True)
if stanza:
try:
node = nbxmpp.Protocol(node=stanza)
node = nbxmpp.Node(node=stanza)
except Exception as error:
ErrorDialog(_('Invalid Node'), str(error))
return
if node.getName() in ('message', 'presence', 'iq'):
# Parse stanza again if its a message, presence or iq and
# set jabber:client as toplevel namespace
# Use type Protocol so nbxmpp counts the stanza for
# stream management
node = nbxmpp.Protocol(node=stanza,
attrs={'xmlns': 'jabber:client'})
app.connections[self.account].connection.send(node)
self.last_stanza = stanza
buffer_.set_text('')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment