From 89a118dff7ecca7332e667d11c37d794484346c7 Mon Sep 17 00:00:00 2001 From: Bram van den Heuvel Date: Mon, 2 Oct 2023 17:22:40 +0200 Subject: [PATCH] Fix incorrect timing bug Fix a bug where the client didn't actually ignore messages that were sent in the past. This could cause a server to stop running because it had been asked to stop in the past, forcing the Matrix room to spam enough messages until the command would no longer appear in the initial sync --- main.py | 1 - src/mxclient.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/main.py b/main.py index 6b24e60..49d07fb 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,3 @@ -import src.mc_wrapper as mc_wrapper import src.mxclient as matrix_client import asyncio diff --git a/src/mxclient.py b/src/mxclient.py index a83da3d..27ce248 100644 --- a/src/mxclient.py +++ b/src/mxclient.py @@ -16,7 +16,7 @@ async def message_callback(room: MatrixRoom, event: RoomMessageText) -> None: return if event.sender == client.user_id: return - if int(event.server_timestamp) < STARTUP_TIME: + if int(event.server_timestamp) / 1000 < STARTUP_TIME: return # Determine how to display username