From c05e76569bc36b5d89d2beac3dc7bdf9945f22c3 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sat, 17 Jan 2026 13:55:16 +0800 Subject: [PATCH] Add more chat type --- Whatsapp_Chat_Exporter/utility.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Whatsapp_Chat_Exporter/utility.py b/Whatsapp_Chat_Exporter/utility.py index c614aef..a253ac2 100644 --- a/Whatsapp_Chat_Exporter/utility.py +++ b/Whatsapp_Chat_Exporter/utility.py @@ -639,11 +639,17 @@ def get_from_string(msg: Dict, chat_id: str) -> str: def get_chat_type(chat_id: str) -> str: """Return the chat type based on the whatsapp id""" - if chat_id.endswith("@s.whatsapp.net"): + if chat_id == "000000000000000": + return "calls" + elif chat_id.endswith("@s.whatsapp.net"): return "personal_chat" - if chat_id.endswith("@g.us"): + elif chat_id.endswith("@g.us"): return "private_group" - logger.warning("Unknown chat type for %s, defaulting to private_group", chat_id) + elif chat_id == "status@broadcast": + return "status_broadcast" + elif chat_id.endswith("@broadcast"): + return "broadcast_channel" + logger.warning(f"Unknown chat type for {chat_id}, defaulting to private_group{CLEAR_LINE}") return "private_group"