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 syncmain
parent
eb5ba196cb
commit
89a118dff7
1
main.py
1
main.py
|
@ -1,4 +1,3 @@
|
||||||
import src.mc_wrapper as mc_wrapper
|
|
||||||
import src.mxclient as matrix_client
|
import src.mxclient as matrix_client
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
|
@ -16,7 +16,7 @@ async def message_callback(room: MatrixRoom, event: RoomMessageText) -> None:
|
||||||
return
|
return
|
||||||
if event.sender == client.user_id:
|
if event.sender == client.user_id:
|
||||||
return
|
return
|
||||||
if int(event.server_timestamp) < STARTUP_TIME:
|
if int(event.server_timestamp) / 1000 < STARTUP_TIME:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Determine how to display username
|
# Determine how to display username
|
||||||
|
|
Loading…
Reference in New Issue