Back to product page

IncomingMessage callback method


Called when new message is received.

Syntax

  • Basic
object.IncomingMessage (Owner, Contact, ChatRoom, Message)
The IncomingMessage(object,Owner,Contact,ChatRoom,Message) syntax has these parts:
objectAn expression evaluating to an object of type IwodXMPPNotify
OwnerAn expression evaluating to an object of type wodXMPP
ContactXMPPContact object
ChatRoomXMPPChatRoom object
MessageXMPPMessage object

Remarks

This method is called only if you implemented IwodXMPPNotify interface in your application, and wodXMPP.Notification property has received reference to instance of your implementation.

Called each time a new message is received. The notification method will provide you with Contact and Message parameters. This is where you can decide what to with the message.

You can determine whether the message that arrived originated from Server or some other user (using Contact parameter).

Contact parameter will return reference to the current XMPPContact object.

ChatRoom parameter is set to Nothing if this is direct message from the contact. If ChatRoom is set, it contains reference to the chat room from where is message coming.

Message provides you with reference to current XMPPMessage object which was received. Note that XMPPMessage object does not contain information about sender of the message - that is why XMPPContact object is provided with this notification method too.

When new message arrives, typically you can show it like this:
MsgBox Msg.Text, vbOKOnly, Msg.Subject


Platforms

Windows