From 6046598ed8c7881464c92a606f6188362c0d5d22 Mon Sep 17 00:00:00 2001 From: n9k Date: Wed, 22 Jun 2022 08:31:06 +0000 Subject: [PATCH] Fix deletion of old messages exceeding threshold --- anonstream/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anonstream/chat.py b/anonstream/chat.py index 91e282c..e791221 100644 --- a/anonstream/chat.py +++ b/anonstream/chat.py @@ -108,7 +108,7 @@ def add_chat_message(user, nonce, comment, ignore_empty=False): MESSAGES_BY_ID[message_id] = message while len(MESSAGES_BY_ID) > CONFIG['MAX_CHAT_MESSAGES']: - MESSAGES_BY_ID.pop(last=False) + MESSAGES_BY_ID.popitem(last=False) # Notify event sockets that a chat message was added notify_event_sockets({