Users: Serve early adopter badge from server.

This commit is contained in:
Paul
2021-05-25 13:37:12 +01:00
parent f1462d4e4d
commit 67b9b8ceee
5 changed files with 31 additions and 12 deletions

View File

@@ -16,6 +16,9 @@ pub enum ChannelPermission {
VoiceCall = 16,
}
impl_op_ex!(+ |a: &ChannelPermission, b: &ChannelPermission| -> u32 { *a as u32 | *b as u32 });
impl_op_ex_commutative!(+ |a: &u32, b: &ChannelPermission| -> u32 { *a | *b as u32 });
bitfield! {
pub struct ChannelPermissions(MSB0 [u32]);
u32;
@@ -26,9 +29,6 @@ bitfield! {
pub get_voice_call, _: 27;
}
impl_op_ex!(+ |a: &ChannelPermission, b: &ChannelPermission| -> u32 { *a as u32 | *b as u32 });
impl_op_ex_commutative!(+ |a: &u32, b: &ChannelPermission| -> u32 { *a | *b as u32 });
impl<'a> PermissionCalculator<'a> {
pub async fn calculate_channel(self) -> Result<u32> {
let channel = if let Some(channel) = self.channel {