Question

I am subscribing to the OnMessage event and it gets called twice when a user sends a message; once when he/she starts typing, in which case the Message objects contents are as follows:

Body = null
Chatstate = composing
Error = null
Headers = null
Html = null
Nickname = null
Subject = null
Thread = null
Type = chat
XDelay = null
XEvent = null

The second time the event is handled the Message argument contains the following:

Body = null
Chatstate = active
Error = null
Headers = null
Html = null
Nickname = null
Subject = null
Thread = null
Type = chat
XDelay = null
XEvent = null

Unless I'm missing something, the second time the event is raised the Body property should not be null, or the event should be raised again containing the message it the first and second event handler calls handled the typing events. Thanks.

Was it helpful?

Solution

you contact is sending chat states without body to you. Otherwise the body would be there. For more information about chat states you can read the XEP here: http://xmpp.org/extensions/xep-0085.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top