more stuff

This commit is contained in:
Zomatree
2024-04-24 02:23:52 +01:00
parent 7a4421089c
commit 67569f932e
11 changed files with 254 additions and 79 deletions

View File

@@ -1,6 +1,7 @@
use std::collections::HashMap;
use super::{File, Role, User};
use crate::if_false;
use iso8601_timestamp::Timestamp;
use once_cell::sync::Lazy;
@@ -57,6 +58,13 @@ auto_derived_partial!(
/// Timestamp this member is timed out until
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub timeout: Option<Timestamp>,
/// Whether the member is server-wide voice muted
#[serde(skip_serializing_if = "if_false")]
pub can_publish: bool,
/// Whether the member is server-wide voice deafened
#[serde(skip_serializing_if = "if_false")]
pub can_receive: bool,
},
"PartialMember"
);
@@ -126,5 +134,9 @@ auto_derived!(
/// Fields to remove from channel object
#[cfg_attr(feature = "validator", validate(length(min = 1)))]
pub remove: Option<Vec<FieldsMember>>,
/// server-wide voice muted
pub can_publish: Option<bool>,
/// server-wide voice deafened
pub can_receive: Option<bool>,
}
);

View File

@@ -276,10 +276,10 @@ auto_derived_partial!(
/// Voice State information for a user
pub struct UserVoiceState {
pub id: String,
pub audio: bool,
pub deafened: bool,
pub can_receive: bool,
pub can_publish: bool,
pub screensharing: bool,
pub camera: bool
pub camera: bool,
},
"PartialUserVoiceState"
);