IncomingMessage Event
    
 

Description

Fires when new message is received.


Syntax

Private Sub object_IncomingMessage(Contact, Message)



The IncomingMessage Event syntax has these parts:

Part Description
object A wodXMPP object.
Contact A XMPPContact object. Provides you with a reference to the contact that sent the message.
ChatRoom A XMPPChatRoom object. Provides you with a reference to chat room from where message is coming.
Message A XMPPMessage object. Provides reference to message object that holds all message information.

Remarks

Fires each time a new message is received. The Event 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 wodXMPPContact 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 event too.

When new message arrives, typically you can show it like this:

MsgBox Msg.Text, vbOKOnly, Msg.Subject