Search code examples
androidxmppsmackasmack

How to get timestamp of incoming xmpp message?


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 please, is it possible at all? Because I can't find anything about this question.

Thanks in advance


Solution

  • Timestamp is not part of the regular messages. Therefore you cannot extract it.

    There is a spec (as mentioned by @Dmitry), but this only applies to specific types of messages. Typically those that are NOT realtime, such as offline and publishing the last pubsub message of a node when a new subscription is created. These are messages with an inherent delay built into them.