Philipp Hörist pushed to branch master at gajim / python-nbxmpp

Commits:
3e725de4 by Philipp Hörist at 2018-08-18T09:11:58Z
Remove stanza sent event

there is no need to make a difference between DATA SENT and STANZA SENT
all data that is sent is also always only a single stanza

- - - - -
9ad2e79d by Philipp Hörist at 2018-08-18T09:16:05Z
Change event name to match other events

- - - - -
24631042 by Philipp Hörist at 2018-08-18T10:29:48Z
Dispatch stream header

- - - - -


2 changed files:

- nbxmpp/dispatcher_nb.py
- nbxmpp/simplexml.py


Changes:

=====================================
nbxmpp/dispatcher_nb.py
=====================================
--- a/nbxmpp/dispatcher_nb.py
+++ b/nbxmpp/dispatcher_nb.py
@@ -418,7 +418,7 @@ class XMPPDispatcher(PlugIn):
         #log.info('dispatch called: stanza = %s, session = %s, direct= %s'
         #       % (stanza, session, direct))
 
-        self.Event('', 'STANZA_RECEIVED', stanza)
+        self.Event('', 'STANZA RECEIVED', stanza)
 
         if not session:
             session = self
@@ -441,7 +441,7 @@ class XMPPDispatcher(PlugIn):
             xmlns = 'unknown'
         # features stanza has been handled before
         if name not in self.handlers[xmlns]:
-            if name != 'features':
+            if name not in ('features', 'stream'):
                 log.warning('Unknown stanza: %s', stanza)
             else:
                 log.debug('Got %s/%s stanza' % (xmlns, name))
@@ -577,8 +577,6 @@ class XMPPDispatcher(PlugIn):
                 if self._owner._registered_name and not stanza.getAttr('from'):
                     stanza.setAttr('from', self._owner._registered_name)
 
-        self.Event('', 'STANZA_SENT', stanza)
-
         self._owner.Connection.send(stanza, now)
 
         # If no ID then it is a whitespace


=====================================
nbxmpp/simplexml.py
=====================================
--- a/nbxmpp/simplexml.py
+++ b/nbxmpp/simplexml.py
@@ -634,6 +634,9 @@ class NodeBuilder(object):
                     self._document_attrs[attr] = val
             ns = self._document_nsp.get(nsp, 
'http://www.gajim.org/xmlns/undeclared-root')
             try:
+                header = Node(tag=tag, attrs=attrs,
+                              nsp=self._document_nsp, node_built=True)
+                self.dispatch(header)
                 self.stream_header_received(ns, name, attrs)
             except ValueError as e:
                 self._document_attrs = None



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/compare/d713ce9059de350ce41f6d41f085d1c1a01742a4...24631042b6f200ef8134b106ac3474a36e94f1c3

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/compare/d713ce9059de350ce41f6d41f085d1c1a01742a4...24631042b6f200ef8134b106ac3474a36e94f1c3
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to