Commit 753b9584 authored by Tom Evans's avatar Tom Evans

OF-670: Cleanup MUC for dropped S2S sessions

Detect "remote-server-not-found" error condition and remove
corresponding MUC users
parent 38492f58
......@@ -74,6 +74,7 @@ import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.Presence;
import org.xmpp.resultsetmanagement.ResultSet;
......@@ -308,11 +309,19 @@ public class MultiUserChatServiceImpl implements Component, MultiUserChatService
return;
}
}
// OF-670: Kick S2S users for undeliverable message bounces;
// error condition set via LocalOutgoingServerSession or OutgoingSessionPromise
if (packet.getError() != null &&
packet.getError().getType().equals(PacketError.Condition.remote_server_not_found)) {
removeUser(packet.getFrom());
}
else {
// The packet is a normal packet that should possibly be sent to the room
JID receipient = packet.getTo();
String roomName = receipient != null ? receipient.getNode() : null;
getChatUser(packet.getFrom(), roomName).process(packet);
}
}
catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
......
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