i got problem when want to receive message, right now i am able to receive message, but some attribut is missing
class MyMessageListener implements MessageListener {
@Override
public void processMessage(Chat chat, Message message) {
Util.DebugLog("message->"+message.toXmlns());
}
}
what i got is
<message to="[email protected]" type="chat" from="[email protected]/ff3b2485"><body asdf="asdf">aaa</body></message>
talk_id and chat type inside message is missing.
This is want i want when receive message
<message to="[email protected]" type="chat" talk_id="304" chat_type="0" from="[email protected]/ff3b2485"><body asdf="asdf">aaa</body></message>
While XMPP does not strictly forbid extending a stanzas by adding custom attributes to pre-defined elements (
message
in your case), it's the best to add the custom data as extra element. This is how most XMPP extensions are designed.So instead of
you have
Then you simply need to write a Provider for
myExtension
and register it with Smack'sProviderManager
.