mirror of
https://git.alemi.dev/mumble-stats-api.git
synced 2024-11-22 16:04:49 +01:00
fix: cannot compare options
This commit is contained in:
parent
69a14793a1
commit
e6b3f41540
1 changed files with 3 additions and 3 deletions
|
@ -39,7 +39,7 @@ impl Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn users(host: &str, port: Option<u16>, username: Option<String>, password: Option<String>) -> std::io::Result<Vec<crate::model::User>> {
|
pub async fn users(host: &str, port: Option<u16>, username: Option<String>, password: Option<String>) -> std::io::Result<Vec<crate::model::User>> {
|
||||||
let username = Some(username.unwrap_or_else(|| ".mumble-stats-api".to_string()));
|
let username = username.unwrap_or_else(|| ".mumble-stats-api".to_string());
|
||||||
let mut channel = ControlChannel::new(host, port).await?;
|
let mut channel = ControlChannel::new(host, port).await?;
|
||||||
let version = proto::Version {
|
let version = proto::Version {
|
||||||
version_v1: None,
|
version_v1: None,
|
||||||
|
@ -49,7 +49,7 @@ impl Session {
|
||||||
os_version: None,
|
os_version: None,
|
||||||
};
|
};
|
||||||
let authenticate = proto::Authenticate {
|
let authenticate = proto::Authenticate {
|
||||||
username: username.clone(),
|
username: Some(username.clone()),
|
||||||
password,
|
password,
|
||||||
tokens: Vec::new(),
|
tokens: Vec::new(),
|
||||||
celt_versions: Vec::new(),
|
celt_versions: Vec::new(),
|
||||||
|
@ -72,7 +72,7 @@ impl Session {
|
||||||
// Ok(tcp::proto::Packet::ChannelState(channel)) => tracing::info!("discovered channel: {:?}", channel.name),
|
// Ok(tcp::proto::Packet::ChannelState(channel)) => tracing::info!("discovered channel: {:?}", channel.name),
|
||||||
proto::Packet::ServerSync(_sync) => break Ok(users),
|
proto::Packet::ServerSync(_sync) => break Ok(users),
|
||||||
proto::Packet::UserState(user) => {
|
proto::Packet::UserState(user) => {
|
||||||
if user.name != username {
|
if user.name.as_ref().is_some_and(|n| n != &username) {
|
||||||
users.push(user.into());
|
users.push(user.into());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue