Refactoring empty filtering

This commit is contained in:
KnugiHK
2024-07-13 14:12:21 +08:00
parent 09e5e1a756
commit 80bdc4414a
3 changed files with 18 additions and 15 deletions

View File

@@ -170,7 +170,7 @@ def get_chat_condition(filter, include, column):
def _is_message_empty(message):
return (message.data is None or message.data == "") and not message.media
def is_chat_empty(chat: ChatStore):
def chat_is_empty(chat: ChatStore):
return len(chat.messages) == 0 or all(_is_message_empty(message) for message in chat.messages.values())