Actually connect channel add listener

Also be less strict about needing channel_info on portal creation
This commit is contained in:
Andrew Ferrazzutti 2022-04-28 03:23:52 -04:00
parent cf4f40efa2
commit 32181e3257
2 changed files with 6 additions and 6 deletions

View File

@ -626,6 +626,7 @@ class Client:
self._add_event_handler("chat_read", self._on_chat_read)
self._add_event_handler("profile_changed", self._on_profile_changed)
self._add_event_handler("perm_changed", self._on_perm_changed)
self._add_event_handler("channel_added", self._on_channel_added)
self._add_event_handler("channel_join", self._on_channel_join)
self._add_event_handler("channel_left", self._on_channel_left)
self._add_event_handler("channel_kicked", self._on_channel_kicked)

View File

@ -944,12 +944,11 @@ class Portal(DBPortal, BasePortal):
# NOTE Calling this after room creation to invite participants
await self._update_participants(source, info.participantInfo)
try:
# TODO Think of better typing for this
assert info.channel_info
await self.backfill(source, is_initial=True, channel_info=info.channel_info)
except Exception:
self.log.exception("Failed to backfill new portal")
if info.channel_info:
try:
await self.backfill(source, is_initial=True, channel_info=info.channel_info)
except Exception:
self.log.exception("Failed to backfill new portal")
# TODO Sync read receipts?