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 bbc51c2f51
commit da140db6c3
4 changed files with 18 additions and 11 deletions
+3 -2
View File
@@ -546,10 +546,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")