Allow people to leave channels
Co-Authored-By: Max <max@zed.dev>
This commit is contained in:
parent
8bc105ca1d
commit
fd5994bc0a
5 changed files with 71 additions and 5 deletions
|
@ -473,8 +473,11 @@ impl Database {
|
|||
) -> Result<RemoveChannelMemberResult> {
|
||||
self.transaction(|tx| async move {
|
||||
let channel = self.get_channel_internal(channel_id, &*tx).await?;
|
||||
self.check_user_is_channel_admin(&channel, admin_id, &*tx)
|
||||
.await?;
|
||||
|
||||
if member_id != admin_id {
|
||||
self.check_user_is_channel_admin(&channel, admin_id, &*tx)
|
||||
.await?;
|
||||
}
|
||||
|
||||
let result = channel_member::Entity::delete_many()
|
||||
.filter(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue