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 @@
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.QName;
import org.jivesoftware.openfire.PacketException;
import org.jivesoftware.openfire.PacketRouter;
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.muc.CannotBeInvitedException;
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.muc.*;
import org.jivesoftware.openfire.user.UserAlreadyExistsException;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.NotFoundException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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.packet.*;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* Representation of users interacting with the chat service. A user
......@@ -384,10 +361,14 @@ public class LocalMUCUser implements MUCUser {
// Packets to a specific node/group/room
MUCRole role = roles.get(group);
if (role == null) {
// 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);
Log.debug( "Ignoring stanza received from a non-occupant of '{}': {}", group, packet.toXML() );
if ( packet.isRequest() )
{
// 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()
|| 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