How to get timestamp of incoming xmpp message?

后端 未结 6 1889
梦谈多话
梦谈多话 2021-02-04 05:05

I am using aSmack library to communicate with remote xmpp server. I am able to send/receive messages, but I want to get timestamp of incoming message.

Could you tell me

6条回答
  •  有刺的猬
    2021-02-04 05:46

    It also works for 4.1.9

    DelayInformation inf = null;
                        inf = (DelayInformation)message.getExtension(DelayInformation.ELEMENT,DelayInformation.NAMESPACE);
                        if (inf != null){
                            Date date = inf.getStamp();
                            System.out.println("date: "+date);
                        }
    

提交回复
热议问题