From ffb6aef96e9e1dd444c682fda95bd124f14c54fa Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Tue, 24 Sep 2024 23:16:40 +0800 Subject: [PATCH] Add handlers for the default and other call state #117 --- Whatsapp_Chat_Exporter/android_handler.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/android_handler.py b/Whatsapp_Chat_Exporter/android_handler.py index 95e83a9..492dfb8 100644 --- a/Whatsapp_Chat_Exporter/android_handler.py +++ b/Whatsapp_Chat_Exporter/android_handler.py @@ -732,7 +732,9 @@ def calls(db, data, timezone_offset, filter_chat): f"call {'to' if call.from_me else 'from'} " f"{call.sender} was " ) - if content['call_result'] == 2: + if content['call_result'] in (0, 4, 7): + call.data += "cancelled." if call.from_me else "missed." + elif content['call_result'] == 2: call.data += "not answered." if call.from_me else "missed." elif content['call_result'] == 3: call.data += "unavailable." @@ -743,6 +745,8 @@ def calls(db, data, timezone_offset, filter_chat): f"initiated and lasted for {call_time} " f"with {call_bytes} data transferred." ) + else: + call.data += "in an unknown state." chat.add_message(content["_id"], call) content = c.fetchone() data["000000000000000"] = chat