Add fallback to Android contact name just like commit 5f6b764

This commit is contained in:
KnugiHK
2023-06-20 13:49:22 +08:00
parent d430c7bfba
commit 55bc62cdc1

View File

@@ -155,7 +155,7 @@ def contacts(db, data):
total_row_number = c.fetchone()[0]
print(f"Processing contacts...({total_row_number})")
c.execute("""SELECT jid, display_name FROM wa_contacts; """)
c.execute("""SELECT jid, COALESCE(display_name, wa_name) as display_name FROM wa_contacts; """)
row = c.fetchone()
while row is not None:
data[row["jid"]] = ChatStore(Device.ANDROID, row["display_name"])