mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Correctly handle the difference between prev and current state
This commit is contained in:
parent
1bb8ec296d
commit
c10cb581c6
12 changed files with 102 additions and 69 deletions
|
@ -272,7 +272,7 @@ class MessageHandler(BaseHandler):
|
|||
If so, returns the version of the event in context.
|
||||
Otherwise, returns None.
|
||||
"""
|
||||
prev_event_id = context.current_state_ids.get((event.type, event.state_key))
|
||||
prev_event_id = context.prev_state_ids.get((event.type, event.state_key))
|
||||
prev_event = yield self.store.get_event(prev_event_id, allow_none=True)
|
||||
if not prev_event:
|
||||
return
|
||||
|
@ -808,8 +808,8 @@ class MessageHandler(BaseHandler):
|
|||
event = builder.build()
|
||||
|
||||
logger.debug(
|
||||
"Created event %s with current state: %s",
|
||||
event.event_id, context.current_state_ids,
|
||||
"Created event %s with state: %s",
|
||||
event.event_id, context.prev_state_ids,
|
||||
)
|
||||
|
||||
defer.returnValue(
|
||||
|
@ -904,7 +904,7 @@ class MessageHandler(BaseHandler):
|
|||
|
||||
if event.type == EventTypes.Redaction:
|
||||
auth_events_ids = yield self.auth.compute_auth_events(
|
||||
event, context.current_state_ids, for_verification=True,
|
||||
event, context.prev_state_ids, for_verification=True,
|
||||
)
|
||||
auth_events = yield self.store.get_events(auth_events_ids)
|
||||
auth_events = {
|
||||
|
@ -924,7 +924,7 @@ class MessageHandler(BaseHandler):
|
|||
"You don't have permission to redact events"
|
||||
)
|
||||
|
||||
if event.type == EventTypes.Create and context.current_state_ids:
|
||||
if event.type == EventTypes.Create and context.prev_state_ids:
|
||||
raise AuthError(
|
||||
403,
|
||||
"Changing the room create event is forbidden",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue