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

better to replace to

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

Replies (2)


Added by Bartosz Małkowski TigaseTeam about 3 years ago

You're right.



Added by Igor Khomenko about 3 years ago

Great, thank you!