From 5b9e84a9f73f3203a0076ec29428514602ce5cb7 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 10 Jul 2020 12:43:21 -0400 Subject: [PATCH] Delay redacting events until we're online --- src/backend/matrix_client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/matrix_client.py b/src/backend/matrix_client.py index c036bccb..fd0241bd 100644 --- a/src/backend/matrix_client.py +++ b/src/backend/matrix_client.py @@ -1190,6 +1190,12 @@ class MatrixClient(nio.AsyncClient): event.event_type = nio.RedactedEvent + while ( + self.models["accounts"][self.user_id].presence == + Presence.State.offline + ): + await asyncio.sleep(0.2) + return await asyncio.gather(*tasks)