mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-09-19 09:09:53 +02:00
Implement quoted message preview for iOS reply bubble (#28)
This commit is contained in:
@@ -29,6 +29,7 @@ def contacts(db, data):
|
|||||||
|
|
||||||
def messages(db, data, media_folder, timezone_offset, filter_date, filter_chat, filter_empty):
|
def messages(db, data, media_folder, timezone_offset, filter_date, filter_chat, filter_empty):
|
||||||
c = db.cursor()
|
c = db.cursor()
|
||||||
|
cursor2 = db.cursor()
|
||||||
# Get contacts
|
# Get contacts
|
||||||
c.execute(
|
c.execute(
|
||||||
f"""SELECT count()
|
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"):
|
if content["ZMETADATA"] is not None and content["ZMETADATA"].startswith(b"\x2a\x14"):
|
||||||
quoted = content["ZMETADATA"][2:19]
|
quoted = content["ZMETADATA"][2:19]
|
||||||
message.reply = quoted.decode()
|
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
|
if content["ZMESSAGETYPE"] == 15: # Sticker
|
||||||
message.sticker = True
|
message.sticker = True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user