Philipp Hörist pushed to branch master at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/gtk/xml_console.py
    ... ... @@ -172,10 +172,18 @@ class XMLConsoleWindow(Gtk.ApplicationWindow):
    172 172
             stanza = buffer_.get_text(begin_iter, end_iter, True)
    
    173 173
             if stanza:
    
    174 174
                 try:
    
    175
    -                node = nbxmpp.Protocol(node=stanza)
    
    175
    +                node = nbxmpp.Node(node=stanza)
    
    176 176
                 except Exception as error:
    
    177 177
                     ErrorDialog(_('Invalid Node'), str(error))
    
    178 178
                     return
    
    179
    +
    
    180
    +            if node.getName() in ('message', 'presence', 'iq'):
    
    181
    +                # Parse stanza again if its a message, presence or iq and
    
    182
    +                # set jabber:client as toplevel namespace
    
    183
    +                # Use type Protocol so nbxmpp counts the stanza for
    
    184
    +                # stream management
    
    185
    +                node = nbxmpp.Protocol(node=stanza,
    
    186
    +                                       attrs={'xmlns': 'jabber:client'})
    
    179 187
                 app.connections[self.account].connection.send(node)
    
    180 188
                 self.last_stanza = stanza
    
    181 189
                 buffer_.set_text('')