ClientXMPP(jid, password, plugin_config=None, plugin_whitelist=None, escape_quotes=True, sasl_mech=None, lang='en', **kwargs)¶
Slixmpp’s client class. (Use only for good, not for evil.)
Typical use pattern:
xmpp = ClientXMPP('firstname.lastname@example.org/resource', 'password') # ... Register plugins and event handlers ... xmpp.connect() xmpp.process(block=False) # block=True will block the current # thread. By default, block=False
jid – The JID of the XMPP user account.
password – The password for the XMPP user account.
plugin_config – A dictionary of plugin configurations.
plugin_whitelist – A list of approved plugins that will be loaded when calling
escape_quotes – Deprecated.
connect(address=(), use_ssl=False, force_starttls=True, disable_starttls=False)¶
Connect to the XMPP server.
When no address is given, a SRV lookup for the server will be attempted. If that fails, the server user in the JID will be used.
address – A tuple containing the server’s host and port.
force_starttls – Indicates that negotiation should be aborted if the server does not advertise support for STARTTLS. Defaults to
disable_starttls – Disables TLS for the connection. Defaults to
use_ssl – Indicates if the older SSL connection method should be used. Defaults to
Remove an item from the roster.
This is done by setting its subscription status to
jid – The JID of the item to remove.
get_roster(callback=None, timeout=None, timeout_callback=None)¶
Request the roster from the server.
callback – Reference to a stream handler function. Will be executed when the roster is received.
register_feature(name, handler, restart=False, order=5000)¶
Register a stream feature handler.
name – The name of the stream feature.
handler – The function to execute if the feature is received.
restart – Indicates if feature processing should halt with this feature. Defaults to
order – The relative ordering in which the feature should be negotiated. Lower values will be attempted earlier when available.
Add or change a roster item.
jid – The JID of the entry to modify.
name – The user’s nickname for this JID.
subscription – The subscription status. May be one of
'none'. If set to
'remove', the entry will be deleted.
groups – The roster groups that contain this item.
timeout – The length of time (in seconds) to wait for a response before continuing if blocking is used. Defaults to
callback – Optional reference to a stream handler function. Will be executed when the roster is received. Implies