mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-09-22 18:43:34 +02:00
Implement empty chat filtering from SQL #112
This commit also removed the old empty chat filtering logic.
This commit is contained in:
@@ -220,6 +220,10 @@ def get_file_name(contact: str, chat: ChatStore):
|
||||
return sanitize_filename(file_name), name
|
||||
|
||||
|
||||
def get_cond_for_empty(enable, jid_field: str, broadcast_field: str):
|
||||
return f"AND (chat.sort_timestamp IS NOT NULL OR {jid_field}='status@broadcast' OR {broadcast_field}>0)" if enable else ""
|
||||
|
||||
|
||||
def get_chat_condition(filter, include, columns, jid=None, platform=None):
|
||||
if filter is not None:
|
||||
conditions = []
|
||||
@@ -245,12 +249,6 @@ def get_chat_condition(filter, include, columns, jid=None, platform=None):
|
||||
else:
|
||||
return ""
|
||||
|
||||
def _is_message_empty(message):
|
||||
return (message.data is None or message.data == "") and not message.media
|
||||
|
||||
def chat_is_empty(chat: ChatStore):
|
||||
return len(chat.messages) == 0 or all(_is_message_empty(message) for message in chat.messages.values())
|
||||
|
||||
|
||||
# Android Specific
|
||||
CRYPT14_OFFSETS = (
|
||||
|
||||
Reference in New Issue
Block a user