mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Use snder and not event ID domain to check if ours
The transaction queue only sends out events that we generate. This was done by checking domain of event ID, but that can no longer be used. Instead, we may as well use the sender field.
This commit is contained in:
parent
b1fffca345
commit
55d9024835
@ -175,7 +175,7 @@ class TransactionQueue(object):
|
|||||||
def handle_event(event):
|
def handle_event(event):
|
||||||
# Only send events for this server.
|
# Only send events for this server.
|
||||||
send_on_behalf_of = event.internal_metadata.get_send_on_behalf_of()
|
send_on_behalf_of = event.internal_metadata.get_send_on_behalf_of()
|
||||||
is_mine = self.is_mine_id(event.event_id)
|
is_mine = self.is_mine_id(event.sender)
|
||||||
if not is_mine and send_on_behalf_of is None:
|
if not is_mine and send_on_behalf_of is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -2293,6 +2293,10 @@ class FederationHandler(BaseHandler):
|
|||||||
|
|
||||||
EventValidator().validate_new(event)
|
EventValidator().validate_new(event)
|
||||||
|
|
||||||
|
# We need to tell the transaction queue to send this out, even
|
||||||
|
# though the sender isn't a local user.
|
||||||
|
event.internal_metadata.send_on_behalf_of = self.hs.hostname
|
||||||
|
|
||||||
try:
|
try:
|
||||||
yield self.auth.check_from_context(room_version, event, context)
|
yield self.auth.check_from_context(room_version, event, context)
|
||||||
except AuthError as e:
|
except AuthError as e:
|
||||||
@ -2342,6 +2346,10 @@ class FederationHandler(BaseHandler):
|
|||||||
raise e
|
raise e
|
||||||
yield self._check_signature(event, context)
|
yield self._check_signature(event, context)
|
||||||
|
|
||||||
|
# We need to tell the transaction queue to send this out, even
|
||||||
|
# though the sender isn't a local user.
|
||||||
|
event.internal_metadata.send_on_behalf_of = get_domain_from_id(event.sender)
|
||||||
|
|
||||||
# XXX we send the invite here, but send_membership_event also sends it,
|
# XXX we send the invite here, but send_membership_event also sends it,
|
||||||
# so we end up making two requests. I think this is redundant.
|
# so we end up making two requests. I think this is redundant.
|
||||||
returned_invite = yield self.send_invite(origin, event)
|
returned_invite = yield self.send_invite(origin, event)
|
||||||
|
Loading…
Reference in New Issue
Block a user