Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
7571bf86
Commit
7571bf86
authored
5 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
make FederationHandler.on_send_join_request async
parent
b3e44f0b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/federation.py
+7
-9
7 additions, 9 deletions
synapse/handlers/federation.py
with
7 additions
and
9 deletions
synapse/handlers/federation.py
+
7
−
9
View file @
7571bf86
...
@@ -1411,9 +1411,7 @@ class FederationHandler(BaseHandler):
...
@@ -1411,9 +1411,7 @@ class FederationHandler(BaseHandler):
return
event
return
event
@defer.inlineCallbacks
async
def
on_send_join_request
(
self
,
origin
,
pdu
):
@log_function
def
on_send_join_request
(
self
,
origin
,
pdu
):
"""
We have received a join event for a room. Fully process it and
"""
We have received a join event for a room. Fully process it and
respond with the current state and auth chains.
respond with the current state and auth chains.
"""
"""
...
@@ -1450,9 +1448,9 @@ class FederationHandler(BaseHandler):
...
@@ -1450,9 +1448,9 @@ class FederationHandler(BaseHandler):
# would introduce the danger of backwards-compatibility problems.
# would introduce the danger of backwards-compatibility problems.
event
.
internal_metadata
.
send_on_behalf_of
=
origin
event
.
internal_metadata
.
send_on_behalf_of
=
origin
context
=
yield
self
.
_handle_new_event
(
origin
,
event
)
context
=
await
self
.
_handle_new_event
(
origin
,
event
)
event_allowed
=
yield
self
.
third_party_event_rules
.
check_event_allowed
(
event_allowed
=
await
self
.
third_party_event_rules
.
check_event_allowed
(
event
,
context
event
,
context
)
)
if
not
event_allowed
:
if
not
event_allowed
:
...
@@ -1470,14 +1468,14 @@ class FederationHandler(BaseHandler):
...
@@ -1470,14 +1468,14 @@ class FederationHandler(BaseHandler):
if
event
.
type
==
EventTypes
.
Member
:
if
event
.
type
==
EventTypes
.
Member
:
if
event
.
content
[
"
membership
"
]
==
Membership
.
JOIN
:
if
event
.
content
[
"
membership
"
]
==
Membership
.
JOIN
:
user
=
UserID
.
from_string
(
event
.
state_key
)
user
=
UserID
.
from_string
(
event
.
state_key
)
yield
self
.
user_joined_room
(
user
,
event
.
room_id
)
await
self
.
user_joined_room
(
user
,
event
.
room_id
)
prev_state_ids
=
yield
context
.
get_prev_state_ids
()
prev_state_ids
=
await
context
.
get_prev_state_ids
()
state_ids
=
list
(
prev_state_ids
.
values
())
state_ids
=
list
(
prev_state_ids
.
values
())
auth_chain
=
yield
self
.
store
.
get_auth_chain
(
state_ids
)
auth_chain
=
await
self
.
store
.
get_auth_chain
(
state_ids
)
state
=
yield
self
.
store
.
get_events
(
list
(
prev_state_ids
.
values
()))
state
=
await
self
.
store
.
get_events
(
list
(
prev_state_ids
.
values
()))
return
{
"
state
"
:
list
(
state
.
values
()),
"
auth_chain
"
:
auth_chain
}
return
{
"
state
"
:
list
(
state
.
values
()),
"
auth_chain
"
:
auth_chain
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment