Don't monitor outbound state events for non-open channel portals

They can never be bridged, so allow them as Matrix-only customizations
This commit is contained in:
Andrew Ferrazzutti 2022-04-23 17:04:41 -04:00
parent eed3baa981
commit 283ff43769
1 changed files with 3 additions and 0 deletions

View File

@ -1092,6 +1092,9 @@ class Portal(DBPortal, BasePortal):
# Misses should be guarded by supports_state_event, but handle this just in case
self.log.error(f"Skipping Matrix state event {evt.event_id} of unsupported type {evt.type}")
return
if not self.is_open:
self.log.info(f"Not bridging f{handler.action_name} change of portal for non-open channel")
return
try:
effective_sender, _ = await self.get_relay_sender(sender, f"{handler.action_name} {evt.event_id}")
await handler.apply(self, effective_sender, evt.prev_content, evt.content)