add: channels/messages database functions

chore: bump contrasted
This commit is contained in:
trisua 2025-04-25 16:22:38 -04:00
parent 4cafea66aa
commit a28072be7f
11 changed files with 358 additions and 6 deletions

View file

@ -17,12 +17,12 @@ pub struct Channel {
/// The position of this channel in the UI.
///
/// Top (0) to bottom.
pub order: usize,
pub position: usize,
}
impl Channel {
/// Create a new [`Channel`].
pub fn new(community: usize, owner: usize, order: usize) -> Self {
pub fn new(community: usize, owner: usize, position: usize) -> Self {
Self {
id: AlmostSnowflake::new(1234567890)
.to_string()
@ -33,7 +33,7 @@ impl Channel {
created: unix_epoch_timestamp() as usize,
minimum_role_read: (CommunityPermission::DEFAULT | CommunityPermission::MEMBER).bits(),
minimum_role_write: (CommunityPermission::DEFAULT | CommunityPermission::MEMBER).bits(),
order,
position,
}
}
}

View file

@ -30,6 +30,8 @@ bitflags! {
const SUPPORTER = 1 << 19;
const MANAGE_REQUESTS = 1 << 20;
const MANAGE_QUESTIONS = 1 << 21;
const MANAGE_CHANNELS = 1 << 22;
const MANAGE_MESSAGES = 1 << 23;
const _ = !0;
}