Commit 1b49e6fd authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Optimization - skip stringprep validation.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@8342 b35dd754-fafc-0310-a699-88a17e54d16e
parent c000c60f
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
package org.jivesoftware.openfire.muc; package org.jivesoftware.openfire.muc;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.util.FastDateFormat; import org.jivesoftware.util.FastDateFormat;
import org.jivesoftware.util.JiveConstants; import org.jivesoftware.util.JiveConstants;
import org.jivesoftware.openfire.user.UserNotFoundException;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import org.xmpp.packet.Message; import org.xmpp.packet.Message;
...@@ -156,8 +156,7 @@ public final class MUCRoomHistory { ...@@ -156,8 +156,7 @@ public final class MUCRoomHistory {
if (nickname != null && nickname.trim().length() > 0) { if (nickname != null && nickname.trim().length() > 0) {
JID roomJID = room.getRole().getRoleAddress(); JID roomJID = room.getRole().getRoleAddress();
// Recreate the sender address based on the nickname and room's JID // Recreate the sender address based on the nickname and room's JID
message.setFrom(new JID(roomJID.getNode(), roomJID.getDomain(), message.setFrom(new JID(roomJID.getNode(), roomJID.getDomain(), nickname, true));
nickname));
} }
else { else {
// Set the room as the sender of the message // Set the room as the sender of the message
......
...@@ -13,12 +13,12 @@ package org.jivesoftware.openfire.muc.spi; ...@@ -13,12 +13,12 @@ package org.jivesoftware.openfire.muc.spi;
import org.dom4j.Element; import org.dom4j.Element;
import org.jivesoftware.database.SequenceManager; import org.jivesoftware.database.SequenceManager;
import org.jivesoftware.util.*;
import org.jivesoftware.openfire.PacketRouter; import org.jivesoftware.openfire.PacketRouter;
import org.jivesoftware.openfire.auth.UnauthorizedException; import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.muc.*; import org.jivesoftware.openfire.muc.*;
import org.jivesoftware.openfire.user.UserAlreadyExistsException; import org.jivesoftware.openfire.user.UserAlreadyExistsException;
import org.jivesoftware.openfire.user.UserNotFoundException; import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.util.*;
import org.xmpp.packet.*; import org.xmpp.packet.*;
import java.util.*; import java.util.*;
...@@ -937,7 +937,7 @@ public class MUCRoomImpl implements MUCRoom { ...@@ -937,7 +937,7 @@ public class MUCRoomImpl implements MUCRoom {
public JID getRoleAddress() { public JID getRoleAddress() {
if (crJID == null) { if (crJID == null) {
crJID = new JID(room.getName(), server.getServiceDomain(), ""); crJID = new JID(room.getName(), server.getServiceDomain(), "", true);
} }
return crJID; return crJID;
} }
......
...@@ -496,12 +496,12 @@ public class ClientSession extends Session { ...@@ -496,12 +496,12 @@ public class ClientSession extends Session {
public void setAuthToken(AuthToken auth, String resource) { public void setAuthToken(AuthToken auth, String resource) {
setAddress(new JID(auth.getUsername(), getServerName(), resource)); setAddress(new JID(auth.getUsername(), getServerName(), resource));
authToken = auth; authToken = auth;
sessionManager.addSession(this);
setStatus(Session.STATUS_AUTHENTICATED); setStatus(Session.STATUS_AUTHENTICATED);
// Set default privacy list for this session // Set default privacy list for this session
setDefaultList(PrivacyListManager.getInstance().getDefaultPrivacyList(auth.getUsername())); setDefaultList(PrivacyListManager.getInstance().getDefaultPrivacyList(auth.getUsername()));
// Add session to the session manager. The session will be added to the routing table as well
sessionManager.addSession(this);
} }
/** /**
...@@ -512,9 +512,10 @@ public class ClientSession extends Session { ...@@ -512,9 +512,10 @@ public class ClientSession extends Session {
public void setAnonymousAuth() { public void setAnonymousAuth() {
// Anonymous users have a full JID. Use the random resource as the JID's node // Anonymous users have a full JID. Use the random resource as the JID's node
String resource = getAddress().getResource(); String resource = getAddress().getResource();
setAddress(new JID(resource, getServerName(), resource)); setAddress(new JID(resource, getServerName(), resource, true));
sessionManager.addAnonymousSession(this);
setStatus(Session.STATUS_AUTHENTICATED); setStatus(Session.STATUS_AUTHENTICATED);
// Add session to the session manager. The session will be added to the routing table as well
sessionManager.addAnonymousSession(this);
} }
/** /**
......
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