Servers: Fix create / leave.
Prevent removal of self / owner.
This commit is contained in:
@@ -21,5 +21,9 @@ pub async fn req(user: User, target: Ref, member: String) -> Result<()> {
|
||||
return Err(Error::InvalidOperation)
|
||||
}
|
||||
|
||||
if target.id == target.owner {
|
||||
return Err(Error::MissingPermission)
|
||||
}
|
||||
|
||||
target.remove_member(&member.id.user).await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user