Fix avatar changes and outgoing meta change deduplication

Also move the telegram ID -> MXID generation to Puppet.get_mxid_from_id()
This commit is contained in:
Tulir Asokan
2018-02-19 19:52:45 +02:00
parent f926727a8d
commit 0a6130607d
6 changed files with 21 additions and 13 deletions
+2
View File
@@ -23,6 +23,7 @@ from telethon.tl.functions.channels import GetChannelsRequest
from .abstract_user import AbstractUser
from .db import BotChat
from . import puppet as pu
config = None
@@ -47,6 +48,7 @@ class Bot(AbstractUser):
async def post_login(self):
info = await self.client.get_me()
self.tgid = info.id
self.mxid = pu.Puppet.get_mxid_from_id(self.tgid)
chat_ids = [id for id, type in self.chats.items() if type == "chat"]
response = await self.client(GetChatsRequest(chat_ids))