From 28b3977f2893a1f2c7d8711821794b50b21632e2 Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Thu, 18 Apr 2024 22:36:59 +0800 Subject: [PATCH] Fix: can not ban guest in room --- internal/op/room.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/op/room.go b/internal/op/room.go index 3204031..70b48c1 100644 --- a/internal/op/room.go +++ b/internal/op/room.go @@ -502,6 +502,9 @@ func (r *Room) BanMember(userID string) error { if r.IsCreator(userID) { return errors.New("you are creator, cannot ban") } + if r.IsGuest(userID) { + return errors.New("cannot ban guest") + } defer func() { r.members.Delete(userID) _ = r.KickUser(userID)