diff options
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r-- | sleekxmpp/xmlstream/stanzabase.py | 8 | ||||
-rw-r--r-- | sleekxmpp/xmlstream/xmlstream.py | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index 64e00626..88276ddf 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -1003,11 +1003,11 @@ class ElementBase(object): last_xml = element element = last_xml - if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang: - element = ET.Element(ename) - if lang: + if lang: + if element.attrib.get('{%s}lang' % XML_NS, default_lang) != lang: + element = ET.Element(ename) element.attrib['{%s}lang' % XML_NS] = lang - parent.append(element) + parent.append(element) element.text = text return element diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py index a1b6ccd6..321e2694 100644 --- a/sleekxmpp/xmlstream/xmlstream.py +++ b/sleekxmpp/xmlstream/xmlstream.py @@ -212,6 +212,9 @@ class XMLStream(object): #: proxy based on the settings in :attr:`proxy_config`. self.use_proxy = False + #: If set to ``True``, attempt to use IPv6. + self.use_ipv6 = True + #: An optional dictionary of proxy settings. It may provide: #: :host: The host offering proxy services. #: :port: The port for the proxy service. |