[Clean]
This commit is contained in:
parent
e8faca34e2
commit
0990ccd526
16 changed files with 139 additions and 393 deletions
|
|
@ -12,10 +12,7 @@ use uuid::Uuid;
|
|||
|
||||
use crate::anonymous_clients::anonymous_manager::generate_username;
|
||||
use crate::calls::call_manager;
|
||||
use crate::data::{
|
||||
communication::{CommunicationType, CommunicationValue, DataTypes},
|
||||
user::User,
|
||||
};
|
||||
use crate::data::communication::{CommunicationType, CommunicationValue, DataTypes};
|
||||
use crate::omega::omega_connection::{WAITING_TASKS, get_omega_connection};
|
||||
use crate::rho::rho_manager;
|
||||
use crate::util::logger::PrintType;
|
||||
|
|
@ -352,7 +349,7 @@ impl AnonymousClientConnection {
|
|||
return;
|
||||
}
|
||||
},
|
||||
None => {
|
||||
_ => {
|
||||
self.send_error_response(&cv.get_id(), CommunicationType::error_no_call_id)
|
||||
.await;
|
||||
return;
|
||||
|
|
@ -370,7 +367,7 @@ impl AnonymousClientConnection {
|
|||
// Find target RhoConnection
|
||||
let target_rho = match rho_manager::get_rho_con_for_user(receiver_id).await {
|
||||
Some(rho) => rho,
|
||||
None => {
|
||||
_ => {
|
||||
self.send_error_response(&cv.get_id(), CommunicationType::error)
|
||||
.await;
|
||||
return;
|
||||
|
|
@ -407,7 +404,7 @@ impl AnonymousClientConnection {
|
|||
return;
|
||||
}
|
||||
},
|
||||
None => {
|
||||
_ => {
|
||||
self.send_error_response(&cv.get_id(), CommunicationType::error)
|
||||
.await;
|
||||
return;
|
||||
|
|
@ -521,15 +518,12 @@ impl AnonymousClientConnection {
|
|||
}
|
||||
|
||||
/// Check if interested in a user and send notification
|
||||
pub async fn are_you_interested(self: Arc<Self>, user: &User) {
|
||||
pub async fn are_you_interested(self: Arc<Self>, user_id: i64) {
|
||||
let interested_guard = self.clone().get_interested_users().await;
|
||||
if interested_guard.contains(&user.user_id) {
|
||||
if interested_guard.contains(&user_id) {
|
||||
let notification = CommunicationValue::new(CommunicationType::client_changed)
|
||||
.add_data_str(DataTypes::user_id, user.user_id.to_string())
|
||||
.add_data_str(
|
||||
DataTypes::user_state,
|
||||
format!("{:?}", user.status.to_string()),
|
||||
);
|
||||
.add_data_str(DataTypes::user_id, user_id.to_string())
|
||||
.add_data_str(DataTypes::user_state, format!("online"));
|
||||
|
||||
self.send_message(¬ification).await;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue