pub enum Event {
Show 17 variants
Online,
Disconnected(Error),
ContactAdded(Item),
ContactRemoved(Item),
ContactChanged(Item),
AvatarRetrieved(Jid, String),
ChatMessage(Option<Id>, BareJid, String, StanzaTimeInfo),
ChatMessageCorrection(Id, BareJid, String, 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),
}
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
MessageId
is a unique identifier for this message. - The
BareJid
is the sender’s JID. - The
String
is the message body. - The
StanzaTimeInfo
about 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
MessageId
is the ID of the message that was corrected. - The
BareJid
is the JID of the other participant in the chat. - The
String
is the new body of the message, to replace the old one. - The
StanzaTimeInfo
is the time the message correction was sent/received
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
MessageId
for the message. - The
BareJid
of the room the message was sent from. - The
RoomNick
of the sender. - A
String
containing the actual message. - The
StanzaTimeInfo
containing time related information for the message.
RoomMessageCorrection(Id, BareJid, RoomNick, String, StanzaTimeInfo)
A message in a MUC was corrected/edited.
- The
MessageId
is the ID of the message that was corrected. - The
BareJid
is the JID of the room where the message was sent. - The
RoomNick
is the nickname of the sender of the message. - The
String
is the new body of the message, to replace the old one. - The
StanzaTimeInfo
is 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
MessageId
for the message. - The room’s
BareJid
. - The sender’s
RoomNick
. - A
String
containing the actual message. - The
StanzaTimeInfo
containing time related information for the message.
RoomPrivateMessageCorrection(Id, BareJid, RoomNick, String, StanzaTimeInfo)
A private message in a MUC was corrected/edited.
- The
MessageId
is the ID of the message that was corrected. - The
BareJid
is the JID of the room where the message was sent. - The
RoomNick
is the nickname of the sender of the message. - The
String
is the new body of the message, to replace the old one. - The
StanzaTimeInfo
is the time the message correction was sent/received
ServiceMessage(Option<Id>, BareJid, String, StanzaTimeInfo)
Service message (eg. server notification) received, with:
- An optional
MessageId
for the message. - The
BareJid
of the entity that sent it. - A
String
containing the actual message. - The
StanzaTimeInfo
containing time related information for the message.
HttpUploadedFile(String)
A file has been uploaded over HTTP; contains the URL of the file.