You write the following ColdFusion CFC methods to handle incoming messages and requests from the IM event gateway. These CFCs receive messages from the IM server and can respond to them by setting a return value.
CFC method |
Message type |
---|---|
onIncomingMessage |
Standard message from IM users. |
onAddBuddyRequest |
Requests from others to add the gateway ID to their buddy list. |
onAddBuddyResponse |
Responses from others to requests from your gateway to add them to your buddy lists. Also used by buddies to ask to be removed from your list. |
onBuddyStatus |
Presence status messages from other users. |
onIMServerMessage |
Error and status messages from the IM server. |
For more information on these methods, see Handling incoming messages.
Applications send outgoing instant messages using the CFML SendGatewayMessage method. Incoming message-handling CFC methods can also send messages, including responses to requests from others to add the ColdFusion gateway's ID to their buddy list. For more information on sending messages, see Sending outgoing messages.
The ColdFusion IM gateway provides the IMGatewayHelper class, a gateway helper that you can access by calling the CFML GetGatewayHelper function. The IMGatewayHelper class has methods that let you do the following:
For more information on using GatewayHelper methods, including lists of all the methods, see Using the GatewayHelper object.