smack - Issue with obtaining the offline messages using openfire server -


offline messages not delivering user when person avails.

delayinformation info = (delayinformation)message.getextension("x","jabber:x:delay");

returns null.

when iterate collection of message.getextensions() , delay urn:xmpp:delay.

can explain on this. i'm using smack , smackx.jar. though smackx.jar has smack.providers it's not taken account.

some suggested use urn:xmpp:delay ,which results in class cast exception.

delayinformation inf = (delayinformation)message.getextension("delay","urn:xmpp:delay");

exception: java.lang.classcastexception: org.jivesoftware.smack.packet.defaultpacketextension

if android using smack library try this:

extensionelement delay = message.getextension("urn:xmpp:delay"); if(message.getextension("urn:xmpp:delay") != null){      log.i("recveived", "delay 1: " + delay.toxml());     log.i("recveived", "delay 2: " + delay.getnamespace());     log.i("recveived", "delay 3: " + delay.getelementname()); } 


log output:

i/recveived: delay 1: <delay xmlns='urn:xmpp:delay' stamp='2017-07-31t04:09:23.224+00:00' from='81.89.100.197'></delay>  i/recveived: delay 2: urn:xmpp:delay  i/recveived: delay 3: delay  

this possibillity:

delayinformation delayinformation = delayinformation.from(message); if (delayinformation != null) {      log.i("recveived", "delay 1 : " + delayinformation.getstamp());     log.i("recveived", "delay 2 : " + delayinformation.getstamp().gettime()); } 

log output:

i/recveived: delay 1: mon jul 31 06:08:58 gmt+02:00 2017 i/recveived: delay 2: 1501474138319 

good luck


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -