Commit 81363d82 authored by Christian Schudt's avatar Christian Schudt

Don't add multiple delayed delivery extension to resent messages.

The issue is that messages, which get resent from offline storage already have an older timestamp.

There should not be another delayed delivery extension, which "overwrites" the old one.

Messages looked like that:
<message><body>...</body><delay xmlns="urn:xmpp:delay" stamp="2016-01-06T13:48:45.312Z"></delay><delay xmlns="urn:xmpp:delay" stamp="2016-01-06T13:49:56.674Z"></delay></message>

Instead the original timestamp should be preserved.
parent 193091d7
......@@ -178,9 +178,11 @@ public class StreamManager {
for (StreamManager.UnackedPacket unacked : unacknowledgedStanzas) {
if (unacked.packet instanceof Message) {
Message m = (Message) unacked.packet;
Element delayInformation = m.addChildElement("delay", "urn:xmpp:delay");
delayInformation.addAttribute("stamp", XMPPDateTimeFormat.format(unacked.timestamp));
delayInformation.addAttribute("from", serverAddress.toBareJID());
if (m.getExtension("delay", "urn:xmpp:delay") == null) {
Element delayInformation = m.addChildElement("delay", "urn:xmpp:delay");
delayInformation.addAttribute("stamp", XMPPDateTimeFormat.format(unacked.timestamp));
delayInformation.addAttribute("from", serverAddress.toBareJID());
}
}
router.route(unacked.packet);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment