diff options
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index 40ae38c9..14c13e72 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -223,6 +223,9 @@ class XMLStream(object): #: stream wrapper itself. self.default_ns = '' + self.default_lang = None + self.peer_default_lang = None + #: The namespace of the enveloping stream element. self.stream_ns = '' @@ -1431,6 +1434,10 @@ class XMLStream(object): if depth == 0: # We have received the start of the root element. root = xml + log.debug('RECV: %s', tostring(root, xmlns=self.default_ns, + stream=self, + top_level=True, + open_only=True)) # Perform any stream initialization actions, such # as handshakes. self.stream_end_event.clear() @@ -1478,6 +1485,8 @@ class XMLStream(object): stanza_type = stanza_class break stanza = stanza_type(self, xml) + if stanza['lang'] is None and self.peer_default_lang: + stanza['lang'] = self.peer_default_lang return stanza def __spawn_event(self, xml): |