message / chat: 'msg_id()' now returns 'file_path.stem' (removed suffix)

This commit is contained in:
2023-09-15 12:20:41 +02:00
parent fc82f85b7c
commit 525cdb92a1
4 changed files with 24 additions and 17 deletions
+3 -2
View File
@@ -543,10 +543,11 @@ class Message():
def msg_id(self) -> str:
"""
Returns an ID that is unique throughout all messages in the same (DB) directory.
Currently this is the file name. The ID is also used for sorting messages.
Currently this is the file name without suffix. The ID is also used for sorting
messages.
"""
if self.file_path:
return self.file_path.name
return self.file_path.stem
else:
raise MessageError("Can't create file ID without a file path")