mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Remove redundant calls to third_party_rules in on_send_{join,leave}
There's not much point in calling these *after* we have decided to accept them into the DAG.
This commit is contained in:
parent
629a951b49
commit
d59378d86b
@ -1567,15 +1567,6 @@ class FederationHandler(BaseHandler):
|
|||||||
|
|
||||||
context = await self._handle_new_event(origin, event)
|
context = await self._handle_new_event(origin, event)
|
||||||
|
|
||||||
event_allowed = await self.third_party_event_rules.check_event_allowed(
|
|
||||||
event, context
|
|
||||||
)
|
|
||||||
if not event_allowed:
|
|
||||||
logger.info("Sending of join %s forbidden by third-party rules", event)
|
|
||||||
raise SynapseError(
|
|
||||||
403, "This event is not allowed in this context", Codes.FORBIDDEN
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"on_send_join_request: After _handle_new_event: %s, sigs: %s",
|
"on_send_join_request: After _handle_new_event: %s, sigs: %s",
|
||||||
event.event_id,
|
event.event_id,
|
||||||
@ -1789,16 +1780,7 @@ class FederationHandler(BaseHandler):
|
|||||||
|
|
||||||
event.internal_metadata.outlier = False
|
event.internal_metadata.outlier = False
|
||||||
|
|
||||||
context = await self._handle_new_event(origin, event)
|
await self._handle_new_event(origin, event)
|
||||||
|
|
||||||
event_allowed = await self.third_party_event_rules.check_event_allowed(
|
|
||||||
event, context
|
|
||||||
)
|
|
||||||
if not event_allowed:
|
|
||||||
logger.info("Sending of leave %s forbidden by third-party rules", event)
|
|
||||||
raise SynapseError(
|
|
||||||
403, "This event is not allowed in this context", Codes.FORBIDDEN
|
|
||||||
)
|
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"on_send_leave_request: After _handle_new_event: %s, sigs: %s",
|
"on_send_leave_request: After _handle_new_event: %s, sigs: %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user