From 2fa2bf86cb385d5b915171d3a9290c2085dea88c Mon Sep 17 00:00:00 2001 From: JasonLG1979 Date: Mon, 26 Jun 2023 15:43:21 -0500 Subject: [PATCH] Don't handle messages that are not intended for us in spirc. This prevents 2 active instances of librespot from effectively arguing over who the current active instance actually is. Without it events recurse. --- connect/src/spirc.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 857a4409..b9d82231 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -872,6 +872,11 @@ impl SpircTask { ); } + // Don't handle messages that are not intended for us. + if !update.recipient.contains(device_id) { + return Ok(()); + } + match update.typ() { MessageType::kMessageTypeHello => self.notify(Some(ident)),