From 4773cf225eddd52c900428f735de616646d0178d Mon Sep 17 00:00:00 2001 From: boxdot Date: Tue, 19 Dec 2023 10:13:50 +0100 Subject: [PATCH] Expose SignalWebSocket::is_closed This is useful to check is the websocket is closed (e.g. after a connectivity loss) and reconnect it in that case. --- libsignal-service/src/websocket.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsignal-service/src/websocket.rs b/libsignal-service/src/websocket.rs index 165d21bc9..8769533d0 100644 --- a/libsignal-service/src/websocket.rs +++ b/libsignal-service/src/websocket.rs @@ -309,6 +309,10 @@ impl SignalWebSocket { ) } + pub fn is_closed(&self) -> bool { + self.request_sink.is_closed() + } + pub(crate) fn take_request_stream( &mut self, ) -> Option {