event.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.

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.

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.

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.

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.

class platypush.message.event.xmpp.XmppConversationEnterEvent(*args, conversation_id: str, **kwargs)[source]#

Bases: XmppConversationEvent

Event triggered when the user enters a conversation.

class platypush.message.event.xmpp.XmppConversationEvent(*args, conversation_id: str, **kwargs)[source]#

Bases: XmppEvent, ABC

Base class for XMPP p2p conversation events.

__init__(*args, conversation_id: str, **kwargs)[source]#
Parameters:

conversation_id – Conversation ID.

class platypush.message.event.xmpp.XmppConversationExitEvent(*args, conversation_id: str, **kwargs)[source]#

Bases: XmppConversationEvent

Event triggered when the user exits a conversation.

class platypush.message.event.xmpp.XmppConversationJoinEvent(*args, is_self: bool, **kwargs)[source]#

Bases: XmppConversationMemberEvent

Event triggered when a user enters a conversation.

class platypush.message.event.xmpp.XmppConversationLeaveEvent(*args, is_self: bool, **kwargs)[source]#

Bases: XmppConversationMemberEvent

Event triggered when the user leaves a conversation.

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.

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.

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.

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.

class platypush.message.event.xmpp.XmppMessageReceivedEvent(*args, body: str, **kwargs)[source]#

Bases: XmppUserEvent

Event triggered when the registered XMPP client receives a message.

__init__(*args, body: str, **kwargs)[source]#
Parameters:

body – The body of the message.

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.

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.

__init__(*args, status: str | None, **kwargs)[source]#
Parameters:

status – New presence status.

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.

class platypush.message.event.xmpp.XmppRoomEnterEvent(*args, is_self: bool, **kwargs)[source]#

Bases: XmppRoomOccupantEvent

Event triggered when a user first enters a room.

class platypush.message.event.xmpp.XmppRoomEvent(*args, room_id: str, **kwargs)[source]#

Bases: XmppEvent, ABC

Base class for XMPP room events.

__init__(*args, room_id: str, **kwargs)[source]#
Parameters:

room_id – Room ID.

class platypush.message.event.xmpp.XmppRoomExitEvent(*args, reason: str | None = None, **kwargs)[source]#

Bases: XmppRoomOccupantEvent

Event triggered when a user exits a room.

__init__(*args, reason: str | None = None, **kwargs)[source]#
Parameters:

reason – Exit reason.

class platypush.message.event.xmpp.XmppRoomInviteAcceptedEvent(*args, room_id: str, **kwargs)[source]#

Bases: XmppRoomEvent

Event triggered when an invite to a room is accepted.

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 or MEDIATED.

  • password – The room password.

  • reason – Optional invite reason.

class platypush.message.event.xmpp.XmppRoomInviteRejectedEvent(*args, room_id: str, **kwargs)[source]#

Bases: XmppRoomEvent

Event triggered when an invite to a room is rejected.

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.

class platypush.message.event.xmpp.XmppRoomLeaveEvent(*args, is_self: bool, **kwargs)[source]#

Bases: XmppRoomOccupantEvent

Event triggered when a user leaves a room.

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.

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.

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.

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.

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.

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.

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.

class platypush.message.event.xmpp.XmppRoomUserUnavailableEvent(*args, is_self: bool, **kwargs)[source]#

Bases: XmppRoomOccupantEvent

Event triggered when a user in a joined room becomes unavailable.

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.

class platypush.message.event.xmpp.XmppUserEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#

Bases: XmppEvent, ABC

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.

class platypush.message.event.xmpp.XmppUserUnavailableEvent(*args, user_id: str, jid: str | None = None, **kwargs)[source]#

Bases: XmppUserEvent

Event triggered when a user the client is subscribed to becomes unavailable.