diff --git a/tg/controllers.py b/tg/controllers.py index a705846..b1efaaa 100644 --- a/tg/controllers.py +++ b/tg/controllers.py @@ -1,10 +1,10 @@ import curses import logging import os -import queue import threading from datetime import datetime from functools import partial +from queue import Queue from tempfile import NamedTemporaryFile from typing import Any, Callable, Dict, Optional @@ -46,7 +46,7 @@ class Controller: def __init__(self, model: Model, view: View, tg: Tdlib) -> None: self.model = model self.view = view - self.queue = queue.Queue() + self.queue: Queue = Queue() self.is_running = True self.tg = tg self.chat_size = 0.5 diff --git a/tg/update_handlers.py b/tg/update_handlers.py index 7f11a2d..a600677 100644 --- a/tg/update_handlers.py +++ b/tg/update_handlers.py @@ -169,7 +169,7 @@ def update_chat_last_msg(controller: Controller, update: Dict[str, Any]): current_chat_id = controller.model.current_chat_id if controller.model.chats.update_chat( - chat_id, last_message=message, order=order + chat_id, last_message=last_message, order=order ): controller._refresh_current_chat(current_chat_id)