4

Is it possible to include to XMPP message time when message was delivered to server?

Now I receive from OpenFire server messages like:

<message id="W45Ky-21" to="eee@jserv.ee" from="ppp@jserv.ee/dfg5465fd" type="chat"><body>test</body></message>

But I need know when message was sended (delivered to server) like:

<message id="W45Ky-21" to="eee@jserv.ee" from="ppp@jserv.ee/dfg5465fd" type="chat"><body>test</body><time>2012-10-12 10:00:52</time></message>
Nik
  • 7,114
  • 8
  • 51
  • 75

1 Answers1

5

XMPP is a realtime protocol, so the message should be routed immediately with only some milliseconds delay. When a recipient is offline and the message gets stored offline and delivered later then the server stamps the message like described here:
XEP-0203: Delayed Delivery

If you want to stamp every outgoing message with a time you could use the created header from XEP-0131: Stanza Headers and Internet Metadata or define your own custom XMPP extension.

Alex
  • 4,066
  • 2
  • 19
  • 21
  • Can you please guide me how can i get server time in with every message? – Sonu Dec 27 '16 at 13:05
  • as said above, a server stamps only offline messages with the time, because all other messages are realtime and don't require a timestamp. – Alex Dec 28 '16 at 11:16
  • Thanks for your reply, But is there any way to add server time in every messages. As, Sometime, I'm not getting delay time in offline messages. – Sonu Dec 28 '16 at 11:36