refactor(chat_manager.py): prevent notification when message is a FileResponse instance

This commit is contained in:
Gabriel Almeida 2023-04-25 22:06:26 -03:00
commit 9f8b474a36

View file

@ -23,7 +23,8 @@ class ChatHistory(Subject):
"""Add a message to the chat history."""
self.history[client_id].append(message)
self.notify()
if not isinstance(message, FileResponse):
self.notify()
def get_history(self, client_id: str, filter=True) -> List[ChatMessage]:
"""Get the chat history for a client."""