Protocols/MSNP/Activities/SDK/Techref/Objectmodel/Objects/Channel/Events/OnIMReceived
<a class="clsStd" href="../index.htm">Channel</a>.OnIMReceived Event (Restricted)
This event fires when an instant message is received from the remote application. The event is labeled "restricted" because it is only available if the application has either the ReplaceIM or ReceiveIM permission flag. For more information, see Standard vs. Advanced Applications.
VBScript Syntax
function Channel_OnIMReceived() ' Instant message was received, inspect the value of Channel.IM ' If ReplaceIM permission, Channel.IM can be written to before it is displayed. End Function
JavaScript Syntax
function Channel_OnDataReceived() { // Instant message was received; inspect the value of Channel.IM // If application has ReplaceIM permission, Channel.IM can be written to before it is displayed. }
Remarks
If an application has the ReceiveIM permission flag, it can inspect the value of Channel.IM. With the ReplaceIM permission flag, it can inspect and modify the value of Channel.IM. If an application has neither permission flag, the OnIMReceived event will not fire, and Channel.IM will remain empty.
Changes must be made to Channel.IM before the OnIMReceived event is finished for the changes to be displayed in the Chat History.