summaryrefslogtreecommitdiff
path: root/sleekxmpp/clientxmpp.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/clientxmpp.py')
-rw-r--r--sleekxmpp/clientxmpp.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/sleekxmpp/clientxmpp.py b/sleekxmpp/clientxmpp.py
index 94ced031..7f606de7 100644
--- a/sleekxmpp/clientxmpp.py
+++ b/sleekxmpp/clientxmpp.py
@@ -54,14 +54,14 @@ class ClientXMPP(BaseXMPP):
:param password: The password for the XMPP user account.
:param ssl: **Deprecated.**
:param plugin_config: A dictionary of plugin configurations.
- :param plugin_whitelist: A list of approved plugins that
- will be loaded when calling
+ :param plugin_whitelist: A list of approved plugins that
+ will be loaded when calling
:meth:`~sleekxmpp.basexmpp.BaseXMPP.register_plugins()`.
:param escape_quotes: **Deprecated.**
"""
- def __init__(self, jid, password, ssl=False, plugin_config={},
- plugin_whitelist=[], escape_quotes=True, sasl_mech=None):
+ def __init__(self, jid, password, plugin_config={}, plugin_whitelist=[],
+ escape_quotes=True, sasl_mech=None, lang='en'):
BaseXMPP.__init__(self, jid, 'jabber:client')
self.set_jid(jid)
@@ -69,15 +69,18 @@ class ClientXMPP(BaseXMPP):
self.plugin_config = plugin_config
self.plugin_whitelist = plugin_whitelist
self.default_port = 5222
+ self.default_lang = lang
self.credentials = {}
self.password = password
- self.stream_header = "<stream:stream to='%s' %s %s version='1.0'>" % (
+ self.stream_header = "<stream:stream to='%s' %s %s %s %s>" % (
self.boundjid.host,
"xmlns:stream='%s'" % self.stream_ns,
- "xmlns='%s'" % self.default_ns)
+ "xmlns='%s'" % self.default_ns,
+ "xml:lang='%s'" % self.default_lang,
+ "version='1.0'")
self.stream_footer = "</stream:stream>"
self.features = set()
@@ -186,7 +189,7 @@ class ClientXMPP(BaseXMPP):
occurs. Defaults to ``True``.
:param timeout: The length of time (in seconds) to wait
for a response before continuing if blocking
- is used. Defaults to
+ is used. Defaults to
:attr:`~sleekxmpp.xmlstream.xmlstream.XMLStream.response_timeout`.
:param callback: Optional reference to a stream handler function.
Will be executed when the roster is received.
@@ -197,7 +200,7 @@ class ClientXMPP(BaseXMPP):
def del_roster_item(self, jid):
"""Remove an item from the roster.
-
+
This is done by setting its subscription status to ``'remove'``.
:param jid: The JID of the item to remove.
@@ -212,7 +215,7 @@ class ClientXMPP(BaseXMPP):
Defaults to ``True``.
:param timeout: The length of time (in seconds) to wait for a response
before continuing if blocking is used.
- Defaults to
+ Defaults to
:attr:`~sleekxmpp.xmlstream.xmlstream.XMLStream.response_timeout`.
:param callback: Optional reference to a stream handler function. Will
be executed when the roster is received.
@@ -230,7 +233,7 @@ class ClientXMPP(BaseXMPP):
response = iq.send(block, timeout, callback)
self.event('roster_received', response)
- if block:
+ if block:
self._handle_roster(response)
return response
@@ -276,7 +279,7 @@ class ClientXMPP(BaseXMPP):
roster[jid]['pending_out'] = (item['ask'] == 'subscribe')
roster[jid].save(remove=(item['subscription'] == 'remove'))
-
+
self.event("roster_update", iq)
if iq['type'] == 'set':
resp = self.Iq(stype='result',