Can anyone please help to show me on how to parse this Event pub element and get the Message object for the following Packet. Maybe my keyword/search term googling is not correct but I'm not able to find anything helpful while looking for the documentation or tutorial about this.
I have read something about PacketParserUtils and XmlPullParser and tried to implement it, I keep on getting null.
Code
EventElement event = groupMessage.getExtension("event", "http://jabber.org/protocol/pubsub#event");
try {
XmlPullParser parser = PacketParserUtils.newXmppParser();
Log.d(TAG, "processStanza event: "+ event.toXML().toString());
parser.setInput(new StringReader(event.toXML().toString()));
Item items = (Item) parser.getProperty("items");
Log.d(TAG, "processStanza: " + items);
} catch (XmlPullParserException e) {
e.printStackTrace();
}
<message to='[email protected]/Resource' from='[email protected]'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='urn:xmpp:mucsub:nodes:messages'>
<item id='17100773132085304799'>
<message xmlns='jabber:client' lang='en' to='[email protected]' from='[email protected]/[email protected]' type='groupchat' id='21D85845-8434-4E0B-BB0C-5768256C5B66'>
<body xmlns='jabber:client'>This is the message</body>
</message>
</item>
</items>
</event>
</message>