mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-18 13:24:18 -05:00
Correctly auth /event/ requests
This commit is contained in:
parent
11fdfaf03b
commit
7f41bcbeec
@ -249,7 +249,7 @@ class FederationHandler(BaseHandler):
|
|||||||
if ev.type != EventTypes.Member:
|
if ev.type != EventTypes.Member:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
domain = UserID.from_string(ev.state_key).domain
|
domain = get_domain_from_id(ev.state_key)
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
@ -1106,13 +1106,14 @@ class FederationHandler(BaseHandler):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if do_auth:
|
if do_auth:
|
||||||
in_room = yield self.auth.check_host_in_room(
|
events = yield self._filter_events_for_server(
|
||||||
event.room_id,
|
origin, event.room_id, [event]
|
||||||
origin
|
|
||||||
)
|
)
|
||||||
if not in_room:
|
if not events:
|
||||||
raise AuthError(403, "Host not in room.")
|
raise AuthError(403, "Host not in room.")
|
||||||
|
|
||||||
|
event = events[0]
|
||||||
|
|
||||||
defer.returnValue(event)
|
defer.returnValue(event)
|
||||||
else:
|
else:
|
||||||
defer.returnValue(None)
|
defer.returnValue(None)
|
||||||
|
Loading…
Reference in New Issue
Block a user