Handles incoming requests for users to add the gateway user name as one of their buddies.
onAddBuddyRequest(CFEvent) |
onIncomingMessage, onAddBuddyResponse, onBuddyStatus, onIMServerMessage
The method must take one parameter, a CFEvent structure with the following fields:
Field |
Description |
|---|---|
gatewayType |
Gateway type, either XMPP or SAMETIME |
gatewayID |
The ID of the gateway instance, as configured in ColdFusion Administrator |
originatorID |
The IM ID of the message originator |
cfcMethod |
This CFC method; by default, onAddBuddyRequest. |
data.MESSAGE |
The message that was sent with the request |
data.SENDER |
The sender's ID; identical to the originatorID field value |
data.RECIPIENT |
The recipient's ID, as specified in the gateway's configuration file |
data.TIMESTAMP |
The date and time when the message was sent |
The function can optionally return a value to send a response message. The return structure must contain the following fields:
Field |
Description |
|---|---|
command |
One of the following:
|
buddyID |
ID to which to send the message. Normally, the value of the CFEvent.data.SENDER field. Not used with the noact command. |
reason |
A text message describing the reason for the action. Not used with the noact command. |
The following example searches for the requested buddy's name in a data source and, if it finds a unique entry, adds the buddy and updates the buddy's status information in an Application scope buddyStatus structure. If it doesn't find the name, it declines the buddy. If there are multiple entries for the buddy name in the database, it tells the gateway not to respond. It logs all actions.
<cffunction name="onAddBuddyRequest"> |
Sign in to your account