Project

General

Profile

Tigase creates a room if user tries to destroy not existent room

Igor Khomenko
Added about 3 years ago

Hi there,

we tried a case where user tries to delete not existent room

according to your code if there is no room with such jid then you create it and only then destroy

I guess it is unnecessary here

https://projects.tigase.org/projects/tigase-muc/repository/revisions/master/entry/src/main/java/tigase/muc/modules/RoomConfigurationModule.java#L220

better to replace to

if (room == null) {
   if(destroy != null){
       throw new MUCException(Authorization.ITEM_NOT_FOUND, "There is no such room.");
   }else{
       room = repository.createNewRoom(roomJID.getBareJID(), senderJID);
   }
}

Replies (2)

(1)
Avatar?id=6098&size=32x32

Added by Bartosz Małkowski TigaseTeam about 3 years ago

You're right.

Fixed.

(1)

Added by Igor Khomenko about 3 years ago

Great, thank you!

    (1-2/2)