feat(xep): Check for null nick before leaveRoom.
Signed-off-by: Ikjot Singh Dhody <ikjotsd@gmail.com>
This commit is contained in:
parent
e6bd6d05cd
commit
a873edb9ec
@ -12,3 +12,8 @@ class InvalidDiscoInfoResponse extends MUCError {}
|
||||
/// Returned when no nickname was specified from the client side while trying to
|
||||
/// perform some actions on the MUC, such as joining the room.
|
||||
class NoNicknameSpecified extends MUCError {}
|
||||
|
||||
/// This error occurs when a user attempts to perform an action that requires
|
||||
/// them to be a member of a room, but they are not currently joined to
|
||||
/// that room.
|
||||
class RoomNotJoinedError extends MUCError {}
|
||||
|
@ -97,6 +97,9 @@ class MUCManager extends XmppManagerBase {
|
||||
_mucRoomCache.remove(roomJid);
|
||||
return nick;
|
||||
});
|
||||
if (nick == null) {
|
||||
return Result(RoomNotJoinedError);
|
||||
}
|
||||
await getAttributes().sendStanza(
|
||||
StanzaDetails(
|
||||
Stanza.presence(
|
||||
|
Loading…
Reference in New Issue
Block a user