Include server time in XMPP message

Can I include a message in an XMPP message when the message was delivered to the server?

Now I get from OpenFire server messages, for example:

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

But I need to know when the message was sent (delivered to the server), for example:

 <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> 
+4
source share
1 answer

XMPP is a real-time protocol, so the message should be immediately redirected with a delay of a few milliseconds. When the recipient is offline and the message is stored offline and delivered later, the server prints the message as described here:
XEP-0203: Delayed Delivery

If you want to print each outgoing message using the time that you could use the created header from XEP-0131: Stanza headers and metadata or define your own custom XMPP extension.

+5
source

Source: https://habr.com/ru/post/1439304/


All Articles