Commit 44fd26c5 authored by Christian Schudt's avatar Christian Schudt

XEP-0016 error messages should set correct from attribute (the sender).

See XEP-0016, example 50.
parent f999e759
...@@ -99,6 +99,7 @@ public class OfflineMessageStrategy extends BasicModule implements ServerFeature ...@@ -99,6 +99,7 @@ public class OfflineMessageStrategy extends BasicModule implements ServerFeature
if (list != null && list.shouldBlockPacket(message)) { if (list != null && list.shouldBlockPacket(message)) {
Message result = message.createCopy(); Message result = message.createCopy();
result.setTo(message.getFrom()); result.setTo(message.getFrom());
result.setFrom(message.getTo());
result.setError(PacketError.Condition.service_unavailable); result.setError(PacketError.Condition.service_unavailable);
XMPPServer.getInstance().getRoutingTable().routePacket(message.getFrom(), result, true); XMPPServer.getInstance().getRoutingTable().routePacket(message.getFrom(), result, true);
return; return;
......
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