From 510b4a7e7db22dd5c1a4096981f8e287b06b7b25 Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sun, 9 Feb 2025 16:13:14 +0800 Subject: [PATCH] Implement quoted message preview for iOS reply bubble (#28) --- Whatsapp_Chat_Exporter/ios_handler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/ios_handler.py b/Whatsapp_Chat_Exporter/ios_handler.py index 296abce..97b0c88 100644 --- a/Whatsapp_Chat_Exporter/ios_handler.py +++ b/Whatsapp_Chat_Exporter/ios_handler.py @@ -29,6 +29,7 @@ def contacts(db, data): def messages(db, data, media_folder, timezone_offset, filter_date, filter_chat, filter_empty): c = db.cursor() + cursor2 = db.cursor() # Get contacts c.execute( f"""SELECT count() @@ -191,7 +192,11 @@ def messages(db, data, media_folder, timezone_offset, filter_date, filter_chat, if content["ZMETADATA"] is not None and content["ZMETADATA"].startswith(b"\x2a\x14"): quoted = content["ZMETADATA"][2:19] message.reply = quoted.decode() - message.quoted_data = None # TODO + cursor2.execute(f"""SELECT ZTEXT + FROM ZWAMESSAGE + WHERE ZSTANZAID LIKE '{message.reply}%'""") + quoted_content = cursor2.fetchone() + message.quoted_data = quoted_content["ZTEXT"] or quoted_content if content["ZMESSAGETYPE"] == 15: # Sticker message.sticker = True