Fix outdated presence for lazy loaded members

This commit is contained in:
vslg
2020-07-01 17:55:03 -03:00
committed by miruka
parent 59198da3b0
commit 6e202c3e27
6 changed files with 55 additions and 39 deletions

View File

@@ -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})"