cargo fmt + clippy fixes, remove unused voice_membership.rs
This commit is contained in:
parent
9821814240
commit
c34ed2a192
13 changed files with 108 additions and 245 deletions
|
|
@ -2,7 +2,11 @@ use anyhow::Result;
|
|||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tracing::info;
|
||||
|
||||
use crate::{domain::{channels, session}, net::state::State, proto::SessionCrypto};
|
||||
use crate::{
|
||||
domain::{channels, session},
|
||||
net::state::State,
|
||||
proto::SessionCrypto,
|
||||
};
|
||||
|
||||
use super::{broadcast_leave, set_channel};
|
||||
|
||||
|
|
@ -22,16 +26,16 @@ pub async fn leave(
|
|||
set_channel(state, session_id, None).await;
|
||||
broadcast_leave(state, channel_id, session_id).await;
|
||||
|
||||
if let Some(tx) = &state.voice_member_tx {
|
||||
if let Some(ref uid) = user_id {
|
||||
let event = serde_json::json!({
|
||||
"type": "left",
|
||||
"channel_id": channel_id,
|
||||
"session_id": session_id,
|
||||
"user_id": uid,
|
||||
});
|
||||
let _ = tx.send(event.to_string());
|
||||
}
|
||||
if let Some(tx) = &state.voice_member_tx
|
||||
&& let Some(ref uid) = user_id
|
||||
{
|
||||
let event = serde_json::json!({
|
||||
"type": "left",
|
||||
"channel_id": channel_id,
|
||||
"session_id": session_id,
|
||||
"user_id": uid,
|
||||
});
|
||||
let _ = tx.send(event.to_string());
|
||||
}
|
||||
|
||||
info!("session {} left {channel_id}", &session_id[..8]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue