Ban user with Smack

Hello,

I want create a moderate room and ban users.

I can ban a user but only if this is not in the room. After, he can join the room.

But I send error 403 when the user is in the room.

Why ?

Thanks !

here my code :

MultiUserChat muc = (MultiUserChat) userMuc.get(login);

userJID = /* return userJID */

muc.banUser(userJID, null);

Hi,

Are you sure that the error is 403 and not 405? Because if it is 405, then you must have tried to ban the user who is a moderator or owner of the room. Which is not allowed.

=)

Hi again,

If the error is 403, then my guess is that the error lies in your code. You probably banned yourself in the process of banning others. 403 is thrown if you joined a room and is banned. Do check your code.

I hope it helps.

Cheers. =D