mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-06-07 16:38:29 +00:00
Bug fix on empty file name for (mostly) ios
This commit is contained in:
@@ -202,7 +202,7 @@ def get_file_name(contact: str, chat: ChatStore):
|
|||||||
if "@" not in contact and contact not in ("000000000000000", "000000000000001", "ExportedChat"):
|
if "@" not in contact and contact not in ("000000000000000", "000000000000001", "ExportedChat"):
|
||||||
raise ValueError("Unexpected contact format: " + contact)
|
raise ValueError("Unexpected contact format: " + contact)
|
||||||
phone_number = contact.split('@')[0]
|
phone_number = contact.split('@')[0]
|
||||||
if "-" in contact:
|
if "-" in contact and chat.name is not None:
|
||||||
file_name = ""
|
file_name = ""
|
||||||
else:
|
else:
|
||||||
file_name = phone_number
|
file_name = phone_number
|
||||||
@@ -210,7 +210,7 @@ def get_file_name(contact: str, chat: ChatStore):
|
|||||||
if chat.name is not None:
|
if chat.name is not None:
|
||||||
if file_name != "":
|
if file_name != "":
|
||||||
file_name += "-"
|
file_name += "-"
|
||||||
file_name += chat.name.replace("/", "-")
|
file_name += chat.name.replace("/", "-").replace("\\", "-")
|
||||||
name = chat.name
|
name = chat.name
|
||||||
else:
|
else:
|
||||||
name = phone_number
|
name = phone_number
|
||||||
|
|||||||
Reference in New Issue
Block a user