Whatever message this page gives is out now! Go check it out!
onAddBuddyResponse(CFEvent) |
| 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, onAddBuddyResponse. |
data.MESSAGE | One of the following:
|
data.SENDER | The sender's ID; identical to the originatorID. |
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. |
<cffunction name="onAddBuddyResponse"> <cfargument name="CFEvent" type="struct" required="YES"> <cflock scope="APPLICATION" timeout="10" type="EXCLUSIVE"> <cfscript> //Do the following only if the buddy accepted the request. if (NOT StructKeyExists(Application, "buddyStatus")) { Application.buddyStatus=StructNew(); } if (#CFEVENT.Data.MESSAGE# IS "accept") { //Create a new entry in the buddyStatus record for the buddy. if (NOT StructKeyExists(Application.buddyStatus, CFEvent.Data.SENDER)) { Application.buddyStatus[#CFEvent.Data.SENDER#]=StructNew(); } //Set the buddy status information to indicate buddy was added. Application.buddyStatus[#CFEvent.Data.SENDER#].status= "Buddy accepted us"; Application.buddyStatus[#CFEvent.Data.SENDER#].timeStamp= CFEvent.Data.TIMESTAMP; Application.buddyStatus[#CFEvent.Data.SENDER#].message= CFEvent.Data.MESSAGE; } </cfscript> </cflock> <!--- Log the information for all responses. ---> <cflog file="#CFEvent.GatewayID#Status" text="onAddBuddyResponse; BUDDY: #CFEvent.Data.SENDER# RESPONSE: #CFEvent.Data.MESSAGE# TIMESTAMP: #CFEvent.Data.TIMESTAMP#"> </cffunction> |