Commit 53ff6796 by qlintonger xeno

再次更新+345

parent 69abda68
...@@ -448,7 +448,7 @@ pub async fn handle_agora_call( ...@@ -448,7 +448,7 @@ pub async fn handle_agora_call(
.unwrap_or_else(|| ONLINE_USERS.iter().find(|e| e.value().split(',').nth(CHANNEL_IDX).unwrap_or("") == channel_id).map(|e| e.key().clone()).unwrap_or_default()) .unwrap_or_else(|| ONLINE_USERS.iter().find(|e| e.value().split(',').nth(CHANNEL_IDX).unwrap_or("") == channel_id).map(|e| e.key().clone()).unwrap_or_default())
}; };
real_host_id = host_id.to_string(); real_host_id = host_id.to_string();
let joined = update_user_status(&host_id, &ONLINE_USERS.get(&host_id).map(|v| v.split(',').next().unwrap_or("idle").to_string()).unwrap_or("idle".into()), &channel_id, true); let joined = update_user_status(&host_id, "calling", &channel_id, true);
update_redis_async(host_id, joined); update_redis_async(host_id, joined);
} }
...@@ -466,6 +466,7 @@ pub async fn handle_agora_call( ...@@ -466,6 +466,7 @@ pub async fn handle_agora_call(
"toID": user_id "toID": user_id
}).to_string(), &user_id).await; }).to_string(), &user_id).await;
} }
if real_host_id != user_id {
// 修改状态数据 // 修改状态数据
let joined = update_user_status( let joined = update_user_status(
&user_id, &user_id,
...@@ -475,6 +476,7 @@ pub async fn handle_agora_call( ...@@ -475,6 +476,7 @@ pub async fn handle_agora_call(
); );
update_redis_async(user_id, joined); update_redis_async(user_id, joined);
} }
}
tokio::spawn(async move { notify_all_clients_to_update_online_users().await; }); tokio::spawn(async move { notify_all_clients_to_update_online_users().await; });
} else { } else {
send_error_message(&target_sender_which, event_sender, from_id, "必须传递to_id").await; send_error_message(&target_sender_which, event_sender, from_id, "必须传递to_id").await;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment