processone/ejabberd — pull request #377 by weiss (2014-12-10 23:10:59+00:00)
Title: Add timestamps to stanzas resent from stream management queue

Initially, I just wanted to add `` tags to stanzas that were resent by the stream management code, so that the receiving client will show the correct timestamps. To do that properly, I ended up creating a larger patch; sorry for that. These commits now also implement the following changes:

* Replace the `jlib:timestamp_to_xml` functions with `jlib:add_delay_info`, which is
* much nicer to use, and
* makes sure we won't add multiple `` tags per stanza, and
* makes sure we consistently add both an XEP-0203 `` tag and an obsolete XEP-0091 `` tag.
* If we want to get rid of that `` tag (as [some comments][1] in our code suggest), we can now just [edit a single place][2] (plus the test suite).
* While at it, save a few CPU cycles by making sure we won't add timestamps to presence stanzas which end up being thrown away by the CSI code.

[1]: https://github.com/processone/ejabberd/blob/ffe3ea89174ac324bd8fca6ad17abbc161771bf9/src/jlib.erl#L644
[2]: https://github.com/weiss/ejabberd/compare/weiss:new-timestamps...drop-xep-0091