From 38a9e6fde1a971b2bf41fe7770fba5691e7f764d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 28 Sep 2023 16:46:43 -0700 Subject: [PATCH] Fix removal of followers on Unfollow --- crates/call/src/call.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/call/src/call.rs b/crates/call/src/call.rs index 6756c2aa53..f5bc05e37a 100644 --- a/crates/call/src/call.rs +++ b/crates/call/src/call.rs @@ -95,7 +95,7 @@ impl ActiveCall { client.add_message_handler(cx.handle(), Self::handle_call_canceled), client.add_request_handler(cx.handle(), Self::handle_follow), client.add_message_handler(cx.handle(), Self::handle_unfollow), - client.add_message_handler(cx.handle(), Self::handle_update_followers), + client.add_message_handler(cx.handle(), Self::handle_update_from_leader), ], client, user_store, @@ -259,14 +259,14 @@ impl ActiveCall { project_id: envelope.payload.project_id, peer_id: envelope.original_sender_id()?, }; - if let Err(ix) = this.followers.binary_search(&follower) { + if let Ok(ix) = this.followers.binary_search(&follower) { this.followers.remove(ix); } Ok(()) }) } - async fn handle_update_followers( + async fn handle_update_from_leader( this: ModelHandle, envelope: TypedEnvelope, _: Arc,