From 41b471362f66c4296b367c9892c9238adff27e18 Mon Sep 17 00:00:00 2001 From: Alex Emmet <111742636+Alex-Emmet@users.noreply.github.com> Date: Sun, 19 Apr 2026 20:59:46 +0200 Subject: [PATCH] [Fix] calls only attach if they exist --- src/rho/connection.rs | 12 ++++++------ src/rho/iota_connection.rs | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/rho/connection.rs b/src/rho/connection.rs index e4ff1b2..604025b 100755 --- a/src/rho/connection.rs +++ b/src/rho/connection.rs @@ -519,12 +519,12 @@ impl GeneralConnection { ]), ); } - - contact_map.insert( - DataTypes::calls, - DataValue::Array(vec_of_filtered_calls), - ); - + if !vec_of_filtered_calls.is_empty() { + contact_map.insert( + DataTypes::calls, + DataValue::Array(vec_of_filtered_calls), + ); + } new_contacts.push(DataValue::container_from_map( &contact_map, )); diff --git a/src/rho/iota_connection.rs b/src/rho/iota_connection.rs index 6e899ed..383ec8b 100755 --- a/src/rho/iota_connection.rs +++ b/src/rho/iota_connection.rs @@ -380,7 +380,9 @@ impl IotaConnection { interested_ids.push(*user_id); // attach calls if exists - if let Some(call_list) = invites.get(user_id) { + if let Some(call_list) = invites.get(user_id) + && !call_list.is_empty() + { user_map .insert(DataTypes::calls, DataValue::Array(call_list.clone())); }