Add option to disable startup sync. Fixes #176
This commit is contained in:
@@ -202,6 +202,7 @@ class Config(DictWithRecursion):
|
||||
copy("bridge.bot_messages_as_notices")
|
||||
copy("bridge.max_initial_member_sync")
|
||||
copy("bridge.sync_channel_members")
|
||||
copy("bridge.startup_sync")
|
||||
copy("bridge.sync_matrix_state")
|
||||
copy("bridge.max_telegram_delete")
|
||||
copy("bridge.allow_matrix_login")
|
||||
|
||||
@@ -171,7 +171,7 @@ class User(AbstractUser):
|
||||
async def post_login(self, info: TLUser = None) -> None:
|
||||
try:
|
||||
await self.update_info(info)
|
||||
if not self.is_bot:
|
||||
if not self.is_bot and config["bridge.startup_sync"]:
|
||||
await self.sync_dialogs()
|
||||
await self.sync_contacts()
|
||||
if config["bridge.catch_up"]:
|
||||
@@ -363,7 +363,7 @@ class User(AbstractUser):
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def get_by_tgid(cls, tgid: int) -> Optional['User']:
|
||||
def get_by_tgid(cls, tgid: TelegramID) -> Optional['User']:
|
||||
try:
|
||||
return cls.by_tgid[tgid]
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user