Update mautrix-appservice dependency

This commit is contained in:
Tulir Asokan
2018-06-24 13:41:58 +03:00
parent 0a171d242f
commit 7c2e689813
3 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -292,13 +292,13 @@ class Portal:
"content": power_levels,
}]
room = await self.main_intent.create_room(alias=alias, is_public=public, is_direct=direct,
invitees=invites or [], name=self.title,
initial_state=initial_state)
if not room:
room_id = await self.main_intent.create_room(alias=alias, is_public=public,
is_direct=direct, invitees=invites or [],
name=self.title, initial_state=initial_state)
if not room_id:
raise Exception(f"Failed to create room for {self.tgid_log}")
self.mxid = room["room_id"]
self.mxid = room_id
self.by_mxid[self.mxid] = self
self.save()
self.az.state_store.set_power_levels(self.mxid, power_levels)
+4 -4
View File
@@ -119,9 +119,9 @@ async def transfer_thumbnail_to_matrix(client, intent, thumbnail_loc, video, mim
width, height = None, None
mime_type = magic.from_buffer(file, mime=True)
uploaded = await intent.upload_file(file, mime_type)
content_uri = await intent.upload_file(file, mime_type)
return DBTelegramFile(id=id, mxc=uploaded["content_uri"], mime_type=mime_type,
return DBTelegramFile(id=id, mxc=content_uri, mime_type=mime_type,
was_converted=False, timestamp=int(time.time()), size=len(file),
width=width, height=height)
@@ -173,9 +173,9 @@ async def _unlocked_transfer_file_to_matrix(db, client, intent, id, location, th
mime_type = new_mime_type
thumbnail = None
uploaded = await intent.upload_file(file, mime_type)
content_uri = await intent.upload_file(file, mime_type)
db_file = DBTelegramFile(id=id, mxc=uploaded["content_uri"],
db_file = DBTelegramFile(id=id, mxc=content_uri,
mime_type=mime_type, was_converted=image_converted,
timestamp=int(time.time()), size=len(file),
width=width, height=height)