feat: ice local and remote changes

This commit is contained in:
Ahmet Kaan Gümüş 2025-04-17 04:09:18 +03:00
parent 4f874d8789
commit 3b122dc4f7
6 changed files with 88 additions and 27 deletions

View file

@ -57,13 +57,16 @@ async fn create_signal(
StatusCode::OK
}
#[debug_handler]
async fn read_signal(
Extension(user_and_expected_signal): Extension<Arc<UserAndExpectedSignal>>,
) -> impl IntoResponse {
let mut target_index = None;
let mut json_body = serde_json::json!("");
for (index, user_and_signal) in USERS_AND_SIGNALS.read().unwrap().iter().enumerate() {
if user_and_signal.signal.get_signal_type() == user_and_expected_signal.expected_signal {
if user_and_signal.signal.get_signal_type() == user_and_expected_signal.expected_signal
&& user_and_signal.user != user_and_expected_signal.user
{
json_body = serde_json::json!(user_and_signal);
target_index = Some(index);
}