Commit 4d49126f authored by Dave Cridland's avatar Dave Cridland Committed by GitHub

Merge pull request #649 from guusdk/OF-1198_MUC-response-nonoccupants

OF-1198: Don't respond to responses of MUC non-occupants.
parents 61534da4 9f9e4ea0
...@@ -20,43 +20,20 @@ ...@@ -20,43 +20,20 @@
package org.jivesoftware.openfire.muc.spi; package org.jivesoftware.openfire.muc.spi;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.dom4j.Element; import org.dom4j.Element;
import org.dom4j.QName;
import org.jivesoftware.openfire.PacketException; import org.jivesoftware.openfire.PacketException;
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.CannotBeInvitedException; import org.jivesoftware.openfire.muc.*;
import org.jivesoftware.openfire.muc.ConflictException;
import org.jivesoftware.openfire.muc.ForbiddenException;
import org.jivesoftware.openfire.muc.HistoryRequest;
import org.jivesoftware.openfire.muc.MUCRole;
import org.jivesoftware.openfire.muc.MUCRoom;
import org.jivesoftware.openfire.muc.MUCUser;
import org.jivesoftware.openfire.muc.MultiUserChatService;
import org.jivesoftware.openfire.muc.NotAcceptableException;
import org.jivesoftware.openfire.muc.NotAllowedException;
import org.jivesoftware.openfire.muc.RegistrationRequiredException;
import org.jivesoftware.openfire.muc.RoomLockedException;
import org.jivesoftware.openfire.muc.ServiceUnavailableException;
import org.jivesoftware.openfire.user.UserAlreadyExistsException; import org.jivesoftware.openfire.user.UserAlreadyExistsException;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.NotFoundException; import org.jivesoftware.util.NotFoundException;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.xmpp.packet.IQ; import org.xmpp.packet.*;
import org.xmpp.packet.JID;
import org.xmpp.packet.Message; import java.util.*;
import org.xmpp.packet.Packet; import java.util.concurrent.ConcurrentHashMap;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.Presence;
/** /**
* Representation of users interacting with the chat service. A user * Representation of users interacting with the chat service. A user
...@@ -384,10 +361,14 @@ public class LocalMUCUser implements MUCUser { ...@@ -384,10 +361,14 @@ public class LocalMUCUser implements MUCUser {
// Packets to a specific node/group/room // Packets to a specific node/group/room
MUCRole role = roles.get(group); MUCRole role = roles.get(group);
if (role == null) { if (role == null) {
// If a non-occupant sends a disco to an address of the form <room@service/nick>, Log.debug( "Ignoring stanza received from a non-occupant of '{}': {}", group, packet.toXML() );
// a MUC service MUST return a <bad-request/> error. if ( packet.isRequest() )
// http://xmpp.org/extensions/xep-0045.html#disco-occupant {
sendErrorPacket(packet, PacketError.Condition.bad_request); // If a non-occupant sends a disco to an address of the form <room@service/nick>,
// a MUC service MUST return a <bad-request/> error.
// http://xmpp.org/extensions/xep-0045.html#disco-occupant
sendErrorPacket( packet, PacketError.Condition.bad_request );
}
} }
else if (IQ.Type.result == packet.getType() else if (IQ.Type.result == packet.getType()
|| IQ.Type.error == packet.getType()) { || IQ.Type.error == packet.getType()) {
......
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