mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 05:26:59 +00:00
fix: prevent short-circuit on permissions
This commit is contained in:
@@ -110,7 +110,13 @@ async fn calculate_channel_permission(
|
||||
|
||||
// 1. Check channel type.
|
||||
let value: PermissionValue = match channel {
|
||||
Channel::SavedMessages { .. } => (*DEFAULT_PERMISSION_SAVED_MESSAGES).into(),
|
||||
Channel::SavedMessages { user, .. } => {
|
||||
if user == &data.perspective.id {
|
||||
(*DEFAULT_PERMISSION_SAVED_MESSAGES).into()
|
||||
} else {
|
||||
0_u64.into()
|
||||
}
|
||||
}
|
||||
Channel::DirectMessage { recipients, .. } => {
|
||||
// 2. Fetch user.
|
||||
let other_user = recipients
|
||||
|
||||
Reference in New Issue
Block a user