Fix outdated presence for lazy loaded members
This commit is contained in:
@@ -6,7 +6,7 @@ import os
|
||||
import sys
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
from typing import Any, DefaultDict, Dict, List, Optional
|
||||
from typing import TYPE_CHECKING, Any, DefaultDict, Dict, List, Optional
|
||||
|
||||
from appdirs import AppDirs
|
||||
|
||||
@@ -23,6 +23,9 @@ from .models.model import Model
|
||||
from .models.model_store import ModelStore
|
||||
from .user_files import Accounts, History, Theme, UISettings, UIState
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .models.items import Presence
|
||||
|
||||
# Logging configuration
|
||||
log.getLogger().setLevel(log.INFO)
|
||||
nio.logger_group.level = nio.log.logbook.ERROR
|
||||
@@ -109,6 +112,8 @@ class Backend:
|
||||
|
||||
self.media_cache: MediaCache = MediaCache(self, cache_dir)
|
||||
|
||||
self.presences: Dict[str, "Presence"] = {}
|
||||
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"{type(self).__name__}(clients={self.clients!r})"
|
||||
|
Reference in New Issue
Block a user