From f018b9567ba7e48000cbb004ec389a23bcbaee97 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 10 Jul 2020 12:31:17 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20offline=20=E2=86=92=20online=20not=20send?= =?UTF-8?q?ing=20pending=20message?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/matrix_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index b499d905..c036bccb 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -522,8 +522,10 @@ class MatrixClient(nio.AsyncClient): mentions = mentions, ) - presence = self.models["accounts"][self.user_id].presence - while presence == Presence.State.offline: + while ( + self.models["accounts"][self.user_id].presence == + Presence.State.offline + ): await asyncio.sleep(0.2) await self._send_message(room_id, content, tx_id)