Commit fa30f7e0 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1504: Caching the session will prevent carbons.

parent d727b51c
...@@ -26,8 +26,6 @@ import org.jivesoftware.openfire.muc.MUCRole; ...@@ -26,8 +26,6 @@ import org.jivesoftware.openfire.muc.MUCRole;
import org.jivesoftware.openfire.muc.MUCRoom; import org.jivesoftware.openfire.muc.MUCRoom;
import org.jivesoftware.openfire.muc.MultiUserChatService; import org.jivesoftware.openfire.muc.MultiUserChatService;
import org.jivesoftware.openfire.muc.NotAllowedException; import org.jivesoftware.openfire.muc.NotAllowedException;
import org.jivesoftware.openfire.session.ClientSession;
import org.jivesoftware.openfire.session.Session;
import org.jivesoftware.util.ElementUtil; import org.jivesoftware.util.ElementUtil;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.xmpp.packet.Packet; import org.xmpp.packet.Packet;
...@@ -96,12 +94,6 @@ public class LocalMUCRole implements MUCRole { ...@@ -96,12 +94,6 @@ public class LocalMUCRole implements MUCRole {
*/ */
private Element extendedInformation; private Element extendedInformation;
/**
* Cache session of local user that is a room occupant. If the room occupant is not a local
* user then nothing will be cached and packets will be sent through the PacketRouter.
*/
private ClientSession session;
/** /**
* Create a new role. * Create a new role.
* *
...@@ -125,8 +117,6 @@ public class LocalMUCRole implements MUCRole { ...@@ -125,8 +117,6 @@ public class LocalMUCRole implements MUCRole {
this.router = packetRouter; this.router = packetRouter;
this.role = role; this.role = role;
this.affiliation = affiliation; this.affiliation = affiliation;
// Cache the user's session (will only work for local users)
this.session = XMPPServer.getInstance().getSessionManager().getSession(presence.getFrom());
extendedInformation = extendedInformation =
DocumentHelper.createElement(QName.get("x", "http://jabber.org/protocol/muc#user")); DocumentHelper.createElement(QName.get("x", "http://jabber.org/protocol/muc#user"));
...@@ -267,14 +257,8 @@ public class LocalMUCRole implements MUCRole { ...@@ -267,14 +257,8 @@ public class LocalMUCRole implements MUCRole {
} }
packet.setTo(user.getAddress()); packet.setTo(user.getAddress());
if (session != null && session.getStatus() == Session.STATUS_AUTHENTICATED) {
// Send the packet directly to the local user session
session.process(packet);
}
else {
router.route(packet); router.route(packet);
} }
}
/** /**
* Calculates and sets the extended presence information to add to the presence. * Calculates and sets the extended presence information to add to the presence.
......
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