xmpp
#
- class platypush.message.event.xmpp.XmppConnectedEvent(*args, client_jabber_id: str, **kwargs)[source]#
Bases:
XmppEvent
Event triggered when the registered XMPP client connects to the server.
- __init__(*args, client_jabber_id: str, **kwargs)#
- Parameters:
client_jabber_id – The Jabber ID associated to the client connection.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppContactAddRequestAcceptedEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#
Bases:
XmppUserEvent
Event triggered when a user contact add request is accepted.
- __init__(*args, user_id: str, jid: str | None = None, **kwargs)#
- Parameters:
user_id – User ID.
jid – The full Jabber ID of the user, if the visibility of the full ID including the client identifier is available.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppContactAddRequestEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#
Bases:
XmppUserEvent
Event triggered when a user adds the client Jabber ID to their contacts list.
- __init__(*args, user_id: str, jid: str | None = None, **kwargs)#
- Parameters:
user_id – User ID.
jid – The full Jabber ID of the user, if the visibility of the full ID including the client identifier is available.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppContactAddRequestRejectedEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#
Bases:
XmppUserEvent
Event triggered when a user contact add request is rejected.
- __init__(*args, user_id: str, jid: str | None = None, **kwargs)#
- Parameters:
user_id – User ID.
jid – The full Jabber ID of the user, if the visibility of the full ID including the client identifier is available.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationAddedEvent(*args, members: Iterable[str] | None = None, **kwargs)[source]#
Bases:
XmppConversationEvent
Event triggered when a conversation is added to the client’s list.
- __init__(*args, members: Iterable[str] | None = None, **kwargs)[source]#
- Parameters:
members – Jabber IDs of the conversation members.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationEnterEvent(*args, conversation_id: str, **kwargs)[source]#
Bases:
XmppConversationEvent
Event triggered when the user enters a conversation.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationEvent(*args, conversation_id: str, **kwargs)[source]#
-
Base class for XMPP p2p conversation events.
- __init__(*args, conversation_id: str, **kwargs)[source]#
- Parameters:
conversation_id – Conversation ID.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationExitEvent(*args, conversation_id: str, **kwargs)[source]#
Bases:
XmppConversationEvent
Event triggered when the user exits a conversation.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationJoinEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppConversationMemberEvent
Event triggered when a user enters a conversation.
- __init__(*args, is_self: bool, **kwargs)#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationLeaveEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppConversationMemberEvent
Event triggered when the user leaves a conversation.
- __init__(*args, is_self: bool, **kwargs)#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationMemberEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppConversationEvent
,XmppUserEvent
,ABC
Base class for XMPP events about conversation members.
- __init__(*args, is_self: bool, **kwargs)[source]#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppConversationNickChangedEvent(*args, old_nick: str | None, new_nick: str | None, **kwargs)[source]#
Bases:
XmppNickChangedEvent
,XmppConversationMemberEvent
Event triggered when a user in a p2p conversation changes their nick.
- __init__(*args, old_nick: str | None, new_nick: str | None, **kwargs)#
- Parameters:
old_nick – Old nick.
new_nick – New nick.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppDisconnectedEvent(*args, reason: str | Exception | None = None, **kwargs)[source]#
Bases:
XmppEvent
Event triggered when the registered XMPP client disconnects from the server.
- __init__(*args, reason: str | Exception | None = None, **kwargs)[source]#
- Parameters:
reason – The reason of the disconnection.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppEvent(*args, client_jabber_id: str, **kwargs)[source]#
Bases:
Event
,ABC
Base class for XMPP events.
- __init__(*args, client_jabber_id: str, **kwargs)[source]#
- Parameters:
client_jabber_id – The Jabber ID associated to the client connection.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppMessageReceivedEvent(*args, body: str, **kwargs)[source]#
Bases:
XmppUserEvent
Event triggered when the registered XMPP client receives a message.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppNickChangedEvent(*args, old_nick: str | None, new_nick: str | None, **kwargs)[source]#
Bases:
XmppUserEvent
,ABC
Base class for XMPP nick changed events.
- __init__(*args, old_nick: str | None, new_nick: str | None, **kwargs)[source]#
- Parameters:
old_nick – Old nick.
new_nick – New nick.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppPresenceChangedEvent(*args, status: str | None, **kwargs)[source]#
Bases:
XmppUserEvent
Event triggered when the reported presence of a user in the contacts list changes.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomAffiliationChangedEvent(*args, affiliation: str, changed_by: str | None = None, reason: str | None = None, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when the affiliation of a user in a room changes.
- __init__(*args, affiliation: str, changed_by: str | None = None, reason: str | None = None, **kwargs)[source]#
- Parameters:
affiliation – New affiliation.
changed_by – Nick of the user who changed the affiliation.
reason – Affiliation change reason.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomEnterEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when a user first enters a room.
- __init__(*args, is_self: bool, **kwargs)#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomEvent(*args, room_id: str, **kwargs)[source]#
-
Base class for XMPP room events.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomExitEvent(*args, reason: str | None = None, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when a user exits a room.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomInviteAcceptedEvent(*args, room_id: str, **kwargs)[source]#
Bases:
XmppRoomEvent
Event triggered when an invite to a room is accepted.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomInviteEvent(*args, mode: str, password: str | None = None, reason: str | None = None, **kwargs)[source]#
Bases:
XmppRoomEvent
,XmppUserEvent
Event triggered when the client is invited to join a room.
- __init__(*args, mode: str, password: str | None = None, reason: str | None = None, **kwargs)[source]#
- Parameters:
user_id – The user who sent the invite.
mode – Invite mode, either
DIRECT
orMEDIATED
.password – The room password.
reason – Optional invite reason.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomInviteRejectedEvent(*args, room_id: str, **kwargs)[source]#
Bases:
XmppRoomEvent
Event triggered when an invite to a room is rejected.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomJoinEvent(*args, members: Iterable[str] | None = None, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when a user joins a room.
- __init__(*args, members: Iterable[str] | None = None, **kwargs)[source]#
- Parameters:
members – List of IDs of the joined members.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomLeaveEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when a user leaves a room.
- __init__(*args, is_self: bool, **kwargs)#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomMessageReceivedEvent(*args, body: str, **kwargs)[source]#
Bases:
XmppMessageReceivedEvent
,XmppRoomOccupantEvent
Event triggered when a message is received on a multi-user conversation joined by the client.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomNickChangedEvent(*args, old_nick: str | None, new_nick: str | None, **kwargs)[source]#
Bases:
XmppNickChangedEvent
,XmppRoomOccupantEvent
Event triggered when a user in a room changes their nick.
- __init__(*args, old_nick: str | None, new_nick: str | None, **kwargs)#
- Parameters:
old_nick – Old nick.
new_nick – New nick.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomOccupantEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppRoomEvent
,XmppUserEvent
,ABC
Base class for XMPP events about room members.
- __init__(*args, is_self: bool, **kwargs)[source]#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomPresenceChangedEvent(*args, status: str | None, **kwargs)[source]#
Bases:
XmppPresenceChangedEvent
,XmppRoomEvent
Event triggered when the reported presence of a user in a room changes.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomRoleChangedEvent(*args, role: str, changed_by: str | None = None, reason: str | None = None, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when the role of a user in a room changes.
- __init__(*args, role: str, changed_by: str | None = None, reason: str | None = None, **kwargs)[source]#
- Parameters:
role – New role.
changed_by – Nick of the user who changed the role.
reason – Role change reason.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomTopicChangedEvent(*args, topic: str | None = None, changed_by: str | None = None, **kwargs)[source]#
Bases:
XmppRoomEvent
Event triggered when the topic of a room is changed.
- __init__(*args, topic: str | None = None, changed_by: str | None = None, **kwargs)[source]#
- Parameters:
topic – New room topic.
changed_by – Nick of the user who changed the topic.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppRoomUserAvailableEvent(*args, is_self: bool, **kwargs)[source]#
Bases:
XmppRoomOccupantEvent
Event triggered when a user in a joined room becomes available.
- __init__(*args, is_self: bool, **kwargs)#
- Parameters:
is_self – True if the event is about the current user.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
Bases:
XmppRoomOccupantEvent
Event triggered when a user in a joined room becomes unavailable.
- Parameters:
is_self – True if the event is about the current user.
Converts the event into a dictionary
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppUserAvailableEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#
Bases:
XmppUserEvent
Event triggered when a user the client is subscribed to becomes available.
- __init__(*args, user_id: str, jid: str | None = None, **kwargs)#
- Parameters:
user_id – User ID.
jid – The full Jabber ID of the user, if the visibility of the full ID including the client identifier is available.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
- class platypush.message.event.xmpp.XmppUserEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#
-
Base class for XMPP user events.
- __init__(*args, user_id: str, jid: str | None = None, **kwargs)[source]#
- Parameters:
user_id – User ID.
jid – The full Jabber ID of the user, if the visibility of the full ID including the client identifier is available.
- as_dict()#
Converts the event into a dictionary
- classmethod build(msg)#
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
- matches_condition(condition)#
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
- classmethod parse(msg)#
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
- classmethod to_dict(msg)#
Converts a Message object into a dictionary
- Parameters:
msg – Message object
Bases:
XmppUserEvent
Event triggered when a user the client is subscribed to becomes unavailable.
- Parameters:
user_id – User ID.
jid – The full Jabber ID of the user, if the visibility of the full ID including the client identifier is available.
Converts the event into a dictionary
Builds an event message from a JSON UTF-8 string/bytearray, a dictionary, or another Event
If the event matches an event condition, it will return an EventMatchResult :param condition: The platypush.event.hook.EventCondition object
Parse a generic message into a key-value dictionary
- Parameters:
msg – Original message. It can be a dictionary, a Message, or a string/bytearray, as long as it’s valid UTF-8 JSON
Converts a Message object into a dictionary
- Parameters:
msg – Message object