fix: check server ownership for text channel

refactor: minor cleanup of code
This commit is contained in:
Paul Makles
2023-10-25 10:39:54 +01:00
committed by Paul Makles
parent 21ffea0f9f
commit 456bf7b42a
7 changed files with 155 additions and 19 deletions

View File

@@ -104,7 +104,9 @@ pub async fn calculate_channel_permissions<P: PermissionQuery>(query: &mut P) ->
ChannelType::ServerChannel => {
query.set_server_from_channel().await;
if query.are_we_a_member().await {
if query.are_we_server_owner().await {
return ChannelPermission::GrantAllSafe.into();
} else if query.are_we_a_member().await {
let mut permissions = calculate_server_permissions(query).await;
permissions.apply(query.get_default_channel_permissions().await);