client1 can send txt message to client2 using
connection.getChatManager().createChat(to, this).sendMessage(message);
How to send other kind of message: like INFO message ? (client1 to client2) ?
Because I want, INFO message should not be displayed in the chat window….is it possible ? using smack, smackx library.
Many Thanks.
What you want do do here is to add an extension to your text message. Here is a rough guide.
The properties are carried in a separate namespace (use
toXML()to look at it) and will not appear in the chat window. On the ‘other side’, the applications usesgetProperty()to retrieve the value.If you do not want key/value pairs, but structured data, use
addExtension()in the message body. This is a little more complicated because you basically have to extendPacketExtension, provide your own namespace. You might even have to write aPacketExtensionProvider.