Compare commits

...

3 Commits

Author SHA1 Message Date
Tulir Asokan 92830c3a64 Bump version to 0.6.0rc1 2019-09-03 00:23:35 +03:00
Tulir Asokan 00faab2213 Ignore Riot web brokenness in edits 2019-09-03 00:22:45 +03:00
Tulir Asokan d6294ebb45 Fix some errors 2019-09-03 00:17:52 +03:00
4 changed files with 16 additions and 5 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
__version__ = "0.6.0"
__version__ = "0.6.1rc1"
__author__ = "Tulir Asokan <tulir@maunium.net>"
@@ -170,7 +170,9 @@ class MatrixParser:
@classmethod
def node_to_tmessage(cls, node: HTMLNode, ctx: RecursionContext) -> TelegramMessage:
if node.tag == "ol":
if node.tag == "mx-reply":
return TelegramMessage("")
elif node.tag == "ol":
return cls.list_to_tmessage(node, ctx)
elif node.tag == "ul":
return cls.list_to_tmessage(node, ctx.enter_list())
+3
View File
@@ -346,7 +346,10 @@ class Portal:
await self.invite_to_matrix(invites or [])
return self.mxid
async with self._room_create_lock:
try:
return await self._create_matrix_room(user, entity, invites)
except Exception:
self.log.exception("Fatal error creating Matrix room")
async def _create_matrix_room(self, user: 'AbstractUser', entity: TypeChat, invites: InviteList
) -> Optional[MatrixRoomID]:
+8 -2
View File
@@ -161,6 +161,12 @@ class User(AbstractUser):
# endregion
# region Telegram connection management
async def try_ensure_started(self) -> None:
try:
await self.ensure_started()
except Exception:
self.log.exception("Exception in ensure_started")
def ensure_started(self, even_if_no_session=False) -> Awaitable['User']:
return super().ensure_started(even_if_no_session)
@@ -400,9 +406,9 @@ class User(AbstractUser):
# endregion
def init(context: 'Context') -> List[Awaitable['User']]:
def init(context: 'Context') -> List[Awaitable[None]]:
global config
config = context.config
users = [User.from_db(user) for user in DBUser.all()]
return [user.ensure_started() for user in users if user.tgid]
return [user.try_ensure_started() for user in users if user.tgid]