pub enum Event {
Show 22 variants
Online,
Disconnected(Error),
ContactAdded(Item),
ContactRemoved(Item),
ContactChanged(Item),
AvatarRetrieved(Jid, String),
ChatMessage(Option<Id>, BareJid, String, StanzaTimeInfo),
ChatMessageCorrection(Id, BareJid, String, StanzaTimeInfo),
AuthConfirm(BareJid, Confirm, StanzaTimeInfo),
AuthReject(BareJid, Confirm, StanzaTimeInfo),
RoomJoined(BareJid),
RoomLeft(BareJid),
RoomMessage(Option<Id>, BareJid, RoomNick, String, StanzaTimeInfo),
RoomMessageCorrection(Id, BareJid, RoomNick, String, StanzaTimeInfo),
RoomSubject(BareJid, Option<RoomNick>, String, StanzaTimeInfo),
RoomPrivateMessage(Option<Id>, BareJid, RoomNick, String, StanzaTimeInfo),
RoomPrivateMessageCorrection(Id, BareJid, RoomNick, String, StanzaTimeInfo),
ServiceMessage(Option<Id>, BareJid, String, StanzaTimeInfo),
HttpUploadedFile(String),
Iq(Iq),
Message(Message),
Presence(Presence),
}Expand description
An Event notifying the client something has happened that may require attention.
This can be an XMPP event received from the server, or existing state communicated by the server to the client, like when receiving the contact list.
Variants§
Online
Client connected.
Disconnected(Error)
Client disconnected; if reconnect is disabled, no more event will be received.
ContactAdded(Item)
Contact received from contact list (roster).
This happens when:
- it was added recently to the contact list
- or when the client just came online and is receiving the existing contact list
ContactRemoved(Item)
Contact removed from contact list (roster).
ContactChanged(Item)
Contact changed in contact list (roster).
This happens when (non-exhaustive):
- the contact’s nickname changed
- the contact’s subscription status changed (eg. they accepted a friend request)
- the contact has been added to or removed from a contact group
AvatarRetrieved(Jid, String)
avatars only.Avatar received for a certain JID, with sender JID / avatar path
The avatar path is relative file path to the avatar data.
NOTE: For now, it’s not possible to configure where the avatars are stored, see issue 112 for more information.
ChatMessage(Option<Id>, BareJid, String, StanzaTimeInfo)
A chat message was received. It may have been delayed on the network.
- The
MessageIdis a unique identifier for this message. - The
BareJidis the sender’s JID. - The
Stringis the message body. - The
StanzaTimeInfoabout when message was received, and when the message was claimed sent.
ChatMessageCorrection(Id, BareJid, String, StanzaTimeInfo)
A message in a one-to-one chat was corrected/edited.
- The
MessageIdis the ID of the message that was corrected. - The
BareJidis the JID of the other participant in the chat. - The
Stringis the new body of the message, to replace the old one. - The
StanzaTimeInfois the time the message correction was sent/received
AuthConfirm(BareJid, Confirm, StanzaTimeInfo)
A XEP-0070 authentication request or confirmation was received.
- The
BareJidis the sender’s JID. - The
Confirmis the info about the authentication request. - The
StanzaTimeInfoabout when message was received, and when the message was claimed sent.
AuthReject(BareJid, Confirm, StanzaTimeInfo)
A XEP-0070 authentication rejection was received.
- The
BareJidis the sender’s JID. - The
Confirmis the info about the authentication request that was rejected. - The
StanzaTimeInfoabout when message was received, and when the message was claimed sent.
RoomJoined(BareJid)
Room joined; client may receive and send messages from/to this BareJid.
RoomLeft(BareJid)
Room left; client may not receive and send messages from/to this BareJid
RoomMessage(Option<Id>, BareJid, RoomNick, String, StanzaTimeInfo)
Room message received with:
- An optional
MessageIdfor the message. - The
BareJidof the room the message was sent from. - The
RoomNickof the sender. - A
Stringcontaining the actual message. - The
StanzaTimeInfocontaining time related information for the message.
RoomMessageCorrection(Id, BareJid, RoomNick, String, StanzaTimeInfo)
A message in a MUC was corrected/edited.
- The
MessageIdis the ID of the message that was corrected. - The
BareJidis the JID of the room where the message was sent. - The
RoomNickis the nickname of the sender of the message. - The
Stringis the new body of the message, to replace the old one. - The
StanzaTimeInfois the time the message correction was sent/received
RoomSubject(BareJid, Option<RoomNick>, String, StanzaTimeInfo)
The subject of a room was received.
RoomPrivateMessage(Option<Id>, BareJid, RoomNick, String, StanzaTimeInfo)
A private message received from a room, containing:
- An optional
MessageIdfor the message. - The room’s
BareJid. - The sender’s
RoomNick. - A
Stringcontaining the actual message. - The
StanzaTimeInfocontaining time related information for the message.
RoomPrivateMessageCorrection(Id, BareJid, RoomNick, String, StanzaTimeInfo)
A private message in a MUC was corrected/edited.
- The
MessageIdis the ID of the message that was corrected. - The
BareJidis the JID of the room where the message was sent. - The
RoomNickis the nickname of the sender of the message. - The
Stringis the new body of the message, to replace the old one. - The
StanzaTimeInfois the time the message correction was sent/received
ServiceMessage(Option<Id>, BareJid, String, StanzaTimeInfo)
Service message (eg. server notification) received, with:
- An optional
MessageIdfor the message. - The
BareJidof the entity that sent it. - A
Stringcontaining the actual message. - The
StanzaTimeInfocontaining time related information for the message.
HttpUploadedFile(String)
A file has been uploaded over HTTP; contains the URL of the file.
Iq(Iq)
escape-hatch only.Variant only available when the “escape-hatch” feature is enabled. Proxies an Iq received as a tokio-xmpp event.
Message(Message)
escape-hatch only.Variant only available when the “escape-hatch” feature is enabled. Proxies a Message received as a tokio-xmpp event.
Presence(Presence)
escape-hatch only.Variant only available when the “escape-hatch” feature is enabled. Proxies a Presence received as a tokio-xmpp event.