MessageIn Event

This event is fired upon receipt of a message.

Syntax

ANSI (Cross Platform)
virtual int FireMessageIn(XMPPMessageInEventParams *e);
typedef struct {
const char *MessageId;
const char *From;
const char *Domain;
const char *Resource;
int MessageType;
const char *Subject;
const char *MessageThread;
const char *MessageText;
const char *MessageHTML;
const char *Other; int reserved; } XMPPMessageInEventParams; Unicode (Windows) virtual INT FireMessageIn(XMPPMessageInEventParams *e);
typedef struct {
LPCWSTR MessageId;
LPCWSTR From;
LPCWSTR Domain;
LPCWSTR Resource;
INT MessageType;
LPCWSTR Subject;
LPCWSTR MessageThread;
LPCWSTR MessageText;
LPCWSTR MessageHTML;
LPCWSTR Other; INT reserved; } XMPPMessageInEventParams;
- (void)onMessageIn:(NSString*)messageId :(NSString*)from :(NSString*)domain :(NSString*)resource :(int)messageType :(NSString*)subject :(NSString*)messageThread :(NSString*)messageText :(NSString*)messageHTML :(NSString*)other;
#define EID_XMPP_MESSAGEIN 8

virtual INT IPWORKSIOT_CALL FireMessageIn(LPSTR &lpszMessageId, LPSTR &lpszFrom, LPSTR &lpszDomain, LPSTR &lpszResource, INT &iMessageType, LPSTR &lpszSubject, LPSTR &lpszMessageThread, LPSTR &lpszMessageText, LPSTR &lpszMessageHTML, LPSTR &lpszOther);

Remarks

When a message is received, the XMPP class will parse the sender's Jabber ID into the From, Domain, and Resource fields. These parameters can be used to track the exact instance of a user's account that originated the message.

MessageId can be used with Jabber extension protocols. The MessageText parameter is the plaintext portion of the message body. MessageHTML will contain any HTML from the message.

Type the type of message received. See MessageType for a list of possible values. For message of type "headline", Subject will reflect the subject of the message. For messages of type "chat", Thread will report the conversation thread for which the current message is a follow-up.

Other will contains any extra data associated with the message but not defined by the XMPP-IM protocol.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 C++ Edition - Version 20.0 [Build 8265]