| ColdFusion 9.0 Resources | onIncomingMessageDescriptionHandles incoming instant messages from other users. Optionally returns a response to the message sender. See alsoonAddBuddyRequest, onAddBuddyResponse, onBuddyStatus, onIMServerMessage, Handling incoming messages in the Developing ColdFusion Applications ParametersThe method must take one parameter, a CFEvent structure with the following fields: 
 ReturnsThe function can optionally return a value to send a response message. The return structure must contain the following fields: 
 ExampleThe following example shows a simple onIncomingMessage method that echoes a message back to the sender. <cffunction name="onIncomingMessage"> 
    <cfargument name="CFEvent" type="struct" required="YES"> 
    <cfset input_mesg = CFEvent.data.MESSAGE>  
    <cfset retValue = structNew()> 
    <cfset retValue.command = "submit"> 
    <cfset retValue.buddyID = CFEvent.originatorID> 
    <cfset retValue.message = "Message Received:" & input_mesg> 
    <cfreturn retValue> 
</cffunction> |