Change how contacts are populated from vCards (fix #167)

Enrichment is now performed before message processing to ensure that all contacts are available, regardless of whether they exist in the ChatCollection.
This commit is contained in:
KnugiHK
2025-10-12 23:18:55 +08:00
parent 2b8af6a2fc
commit da4cea6230
3 changed files with 23 additions and 23 deletions

View File

@@ -304,12 +304,10 @@ def _process_single_message(data, content, table_message, timezone_offset):
return
# Get or create the chat
if not data.get_chat(content["key_remote_jid"]):
current_chat = data.get_chat(content["key_remote_jid"])
if current_chat is None:
current_chat = data.add_chat(content["key_remote_jid"], ChatStore(
Device.ANDROID, content["chat_subject"]))
else:
current_chat = data.get_chat(content["key_remote_jid"])
# Determine sender_jid_row_id
if "sender_jid_row_id" in content:
sender_jid_row_id = content["sender_jid_row_id"]