Presence Event
This event is fired when the presence of a subscribed entity changes.
Syntax
typedef void __fastcall (__closure *TipwXMPPPresenceEvent)(System::TObject* Sender, TipwXMPPPresenceEventParams *e);__property TipwXMPPPresenceEvent OnPresence = {read=FOnPresence, write=FOnPresence};
typedef struct {
String User;
String Domain;
String Resource;
int Availability;
String Status;
} TipwXMPPPresenceEventParams;
Remarks
This event contains the availability and status information of a particular Jabber entity to whom this entity has a subscription.
Because a user can log in multiple times using the same account, the XMPP component will parse the user's Jabber ID into the User, Domain and Resource parameters so that the client can easily track which instance of the account sent the presence.
The XMPP protocol permits XMPP (Jabber) clients to communicate with foreign IM networks such as AIM, MSN, SMS, and others through the use of gateway servers that translate between the foreign protocol and XMPP. When sending or receiving presence information, messages, or subscription requests, Domain will be a gateway for the foreign network on which the contact resides and with which this user has registered an account for that foreign network. The Register method can be used to register with a foreign network gateway.
Availability corresponds to the Presence property of the component, with the same possible values:
pcOffline (0) | Invisible: JabberId is offline. |
pcChat (1) | Available: JabberId is online. |
pcAway (2) | Away: JabberId is online, but the user is away from their computer. |
pcXA (3) | Extended Away: JabberId is online, but the user is away from their computer for an extended period of time. |
pcDND (4) | Do not Disturb: JabberId is online, but is busy and does not wish to be disturbed. |
By default, the component sets the client presence to pcChat, meaning that the user is available. To change the initial status sent by the component set Presence to the desired presence before calling Connect.
Note: offline is not officially supported by the XMPP specification, however some XMPP server implementations may recognize the value. Setting the client's presence state to this value may cause the server to respond with an Error.
Status corresponds to the Status property. This value may be any random string, including the empty string, "".