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)
+1 -1
View File
@@ -25,7 +25,7 @@ setuptools.setup(
install_requires=[
"aiohttp>=3.0.1,<4",
"mautrix-appservice>=0.2.0,<0.3.0",
"mautrix-appservice>=0.3.0,<0.4.0",
"SQLAlchemy>=1.2.3,<2",
"alembic>=0.9.8,<0.10",
"Markdown>=2.6.11,<3",