Commit 8d2f0722 authored by Guus der Kinderen's avatar Guus der Kinderen

Merge pull request #492 from sco0ter/smDelay

Don't add multiple delayed delivery extension to resent messages.
parents 5b11857d 81363d82
...@@ -178,9 +178,11 @@ public class StreamManager { ...@@ -178,9 +178,11 @@ public class StreamManager {
for (StreamManager.UnackedPacket unacked : unacknowledgedStanzas) { for (StreamManager.UnackedPacket unacked : unacknowledgedStanzas) {
if (unacked.packet instanceof Message) { if (unacked.packet instanceof Message) {
Message m = (Message) unacked.packet; Message m = (Message) unacked.packet;
Element delayInformation = m.addChildElement("delay", "urn:xmpp:delay"); if (m.getExtension("delay", "urn:xmpp:delay") == null) {
delayInformation.addAttribute("stamp", XMPPDateTimeFormat.format(unacked.timestamp)); Element delayInformation = m.addChildElement("delay", "urn:xmpp:delay");
delayInformation.addAttribute("from", serverAddress.toBareJID()); delayInformation.addAttribute("stamp", XMPPDateTimeFormat.format(unacked.timestamp));
delayInformation.addAttribute("from", serverAddress.toBareJID());
}
} }
router.route(unacked.packet); 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