cmm: limited the message locations for the new cmm parameters to those that make sense

This commit is contained in:
2023-10-20 09:14:40 +02:00
parent 72d31c26e9
commit 40d0de50de
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -325,6 +325,8 @@ class ChatDB(Chat):
when reading them.
* 'loc': read messages from given location instead of 'db_path'
"""
if loc == msg_location.MEM:
raise ChatError(f"Can't build ChatDB from message location '{loc}'")
messages: list[Message] = []
if loc in [msg_location.DB, msg_location.DISK, msg_location.ALL]:
messages.extend(read_dir(db_path, glob, mfilter))