Handle deleted message in new schema

Related to #39 and #9
This commit is contained in:
KnugiHK
2023-04-25 13:02:20 +08:00
parent 7c0b90d458
commit c7a01bb9c0

View File

@@ -293,7 +293,7 @@ def messages(db, data):
else: else:
data[content["key_remote_jid"]].messages[content["_id"]].caption = None data[content["key_remote_jid"]].messages[content["_id"]].caption = None
if content["status"] == 6: if content["status"] == 6: # 6 = Metadata, otherwise it's a message
if (not table_message and "-" in content["key_remote_jid"]) or \ if (not table_message and "-" in content["key_remote_jid"]) or \
(table_message and content["chat_subject"] is not None): (table_message and content["chat_subject"] is not None):
# Is Group # Is Group
@@ -342,7 +342,7 @@ def messages(db, data):
else: else:
if content["key_from_me"] == 1: if content["key_from_me"] == 1:
if content["status"] == 5 and content["edit_version"] == 7: if content["status"] == 5 and content["edit_version"] == 7 or table_message and content["message_type"] == 15:
msg = "Message deleted" msg = "Message deleted"
data[content["key_remote_jid"]].messages[content["_id"]].meta = True data[content["key_remote_jid"]].messages[content["_id"]].meta = True
else: else:
@@ -357,7 +357,7 @@ def messages(db, data):
if "\n" in msg: if "\n" in msg:
msg = msg.replace("\n", "<br>") msg = msg.replace("\n", "<br>")
else: else:
if content["status"] == 0 and content["edit_version"] == 7: if content["status"] == 0 and content["edit_version"] == 7 or table_message and content["message_type"] == 15:
msg = "Message deleted" msg = "Message deleted"
data[content["key_remote_jid"]].messages[content["_id"]].meta = True data[content["key_remote_jid"]].messages[content["_id"]].meta = True
else: else: