From 4a0be0233cc789e6b4ee41e24ebeaab3203955d3 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sun, 2 Mar 2025 11:25:01 +0800 Subject: [PATCH] Bug fix on model change for Message --- Whatsapp_Chat_Exporter/utility.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Whatsapp_Chat_Exporter/utility.py b/Whatsapp_Chat_Exporter/utility.py index b5c4e10..1ec302d 100644 --- a/Whatsapp_Chat_Exporter/utility.py +++ b/Whatsapp_Chat_Exporter/utility.py @@ -235,10 +235,12 @@ def import_from_json(json_file: str, data: Dict[str, ChatStore]): chat.status = chat_data.get("status") for id, msg in chat_data.get("messages").items(): message = Message( - msg["from_me"], - msg["timestamp"], - msg["time"], - msg["key_id"], + from_me=msg["from_me"], + timestamp=msg["timestamp"], + time=msg["time"], + key_id=msg["key_id"], + received_timestamp=msg.get("received_timestamp"), + read_timestamp=msg.get("read_timestamp") ) message.media = msg.get("media") message.meta = msg.get("meta")