fix: use a valid default permission set for groups

This commit is contained in:
Paul Makles
2024-02-12 21:23:38 +00:00
parent a641034895
commit d4d5b23c7d
2 changed files with 3 additions and 3 deletions

View File

@@ -23,6 +23,6 @@
"channel_type": "Group", "channel_type": "Group",
"name": "My Group", "name": "My Group",
"owner": "__ID:0__", "owner": "__ID:0__",
"recipients": ["__ID:0__", "__ID:1__", "__ID:2__"] "recipients": ["__ID:0__", "__ID:1__"]
} }
] ]

View File

@@ -2,7 +2,7 @@ use std::borrow::Cow;
use revolt_permissions::{ use revolt_permissions::{
calculate_user_permissions, ChannelType, Override, PermissionQuery, PermissionValue, calculate_user_permissions, ChannelType, Override, PermissionQuery, PermissionValue,
RelationshipStatus, RelationshipStatus, DEFAULT_PERMISSION_DIRECT_MESSAGE,
}; };
use crate::{Channel, Database, Member, Server, User}; use crate::{Channel, Database, Member, Server, User};
@@ -209,7 +209,7 @@ impl PermissionQuery for DatabasePermissionQuery<'_> {
match channel { match channel {
Cow::Borrowed(Channel::Group { permissions, .. }) Cow::Borrowed(Channel::Group { permissions, .. })
| Cow::Owned(Channel::Group { permissions, .. }) => Override { | Cow::Owned(Channel::Group { permissions, .. }) => Override {
allow: permissions.unwrap_or_default() as u64, allow: permissions.unwrap_or(*DEFAULT_PERMISSION_DIRECT_MESSAGE as i64) as u64,
deny: 0, deny: 0,
}, },
Cow::Borrowed(Channel::TextChannel { Cow::Borrowed(Channel::TextChannel {