mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 01:14:48 -04:00
Pass room version object into event_auth.check and check_redaction (#6788)
These are easier to work with than the strings and we normally have one around. This fixes `FederationHander._persist_auth_tree` which was passing a RoomVersion object into event_auth.check instead of a string.
This commit is contained in:
parent
02b44db922
commit
a8ce7aeb43
8 changed files with 54 additions and 35 deletions
|
@ -26,6 +26,7 @@ import synapse.state
|
|||
from synapse import event_auth
|
||||
from synapse.api.constants import EventTypes
|
||||
from synapse.api.errors import AuthError
|
||||
from synapse.api.room_versions import KNOWN_ROOM_VERSIONS
|
||||
from synapse.events import EventBase
|
||||
from synapse.types import StateMap
|
||||
|
||||
|
@ -402,6 +403,7 @@ def _iterative_auth_checks(
|
|||
Deferred[StateMap[str]]: Returns the final updated state
|
||||
"""
|
||||
resolved_state = base_state.copy()
|
||||
room_version_obj = KNOWN_ROOM_VERSIONS[room_version]
|
||||
|
||||
for event_id in event_ids:
|
||||
event = event_map[event_id]
|
||||
|
@ -430,7 +432,7 @@ def _iterative_auth_checks(
|
|||
|
||||
try:
|
||||
event_auth.check(
|
||||
room_version,
|
||||
room_version_obj,
|
||||
event,
|
||||
auth_events,
|
||||
do_sig_check=False,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue