-
Notifications
You must be signed in to change notification settings - Fork 298
Event Index
Every event is composed of an event name and an optional data object. In most cases, the data object is a message or presence stanza object. Some events do not provide any additional data beyond the default value, which is an empty dictionary.
More recent list of events available on official documentation site
To add a custom event handler, use the following:
xmpp.add_event_handler("event_name", my_handler)
Where xmpp
is a SleekXMPP client or component object, and my_handler
is
a function that can accept a single value which is the event data associated
with event_name
.
-
connected
-
Data:
{}
Source: ClientXMPPSignal that a connection has been made with the XMPP server, but a session has not yet been established.
-
changed_subscription
-
Data: Presence Source: BaseXMPP
Triggered whenever a presence stanza with a type of
subscribe
,subscribed
,unsubscribe
, orunsubscribed
is received.Note that if the values
xmpp.auto_authorize
andxmpp.auto_subscribe
are set toTrue
orFalse
, and notNone
, then SleekXMPP will either accept or reject all subscription requests before your event handlers are called. Set these values toNone
if you wish to make more complex subscription decisions.
-
disco_info_request
-
Data: DiscoInfo Source: XEP-0030
Note: In development.
Notice that a
disco#info
query has been received and a response is needed. Thexep_0030
plugin already handles this event, but that handler will not run if you register your own handler. See the [[XEP-0030 docs|http://wiki.github.com/fritzy/SleekXMPP/XEP-0030:-Working-with-Service-Discovery]] for more information.
-
disco_items
-
Data: DiscoItems Source: XEP-0030
Note: In development.
Triggered whenever a
disco#items
result stanza is received.
-
disco_items_request
-
Data: DiscoItems Source: XEP-0030
Note: In development.
Notice that a
disco#items
query has been received and a response is needed. Thexep_0030
plugin already handles this event, but that handler will not run if you register your own handler. See the [[XEP-0030 docs|http://wiki.github.com/fritzy/SleekXMPP/XEP-0030:-Working-with-Service-Discovery]] for more information.
-
disconnected
-
Data:
{}
Source: ClientXMPPSignal that the connection with the XMPP server has been lost.
-
failed_auth
-
Data:
{}
Source: ClientXMPP,Signal that the server has rejected the provided login credentials.
-
gmail_notify
-
Data:
{}
Source: GmailSignal that there are unread emails for the Gmail account associated with the current XMPP account.
-
roster_update
-
Data: Roster Source: ClientXMPP
An IQ result containing roster entries is received.
-
sent_presence
-
Data:
{}
Source: BaseXMPPSignal that an initial presence stanza has been written to the XML stream.
-
session_start
-
Data:
{}
Source:Signal that a connection to the XMPP server has been made and a session has been established.