Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
7f7b2cd3
Commit
7f7b2cd3
authored
6 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Make room_member_handler a member of RoomCreationHandler
... to save passing it into `_send_events_for_new_room`
parent
871c4abf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/handlers/register.py
+4
-2
4 additions, 2 deletions
synapse/handlers/register.py
synapse/handlers/room.py
+3
-6
3 additions, 6 deletions
synapse/handlers/room.py
with
7 additions
and
8 deletions
synapse/handlers/register.py
+
4
−
2
View file @
7f7b2cd3
...
...
@@ -50,7 +50,6 @@ class RegistrationHandler(BaseHandler):
self
.
_auth_handler
=
hs
.
get_auth_handler
()
self
.
profile_handler
=
hs
.
get_profile_handler
()
self
.
user_directory_handler
=
hs
.
get_user_directory_handler
()
self
.
room_creation_handler
=
self
.
hs
.
get_room_creation_handler
()
self
.
captcha_client
=
CaptchaServerHttpClient
(
hs
)
self
.
_next_generated_user_id
=
None
...
...
@@ -241,7 +240,10 @@ class RegistrationHandler(BaseHandler):
else
:
# create room expects the localpart of the room alias
room_alias_localpart
=
room_alias
.
localpart
yield
self
.
room_creation_handler
.
create_room
(
# getting the RoomCreationHandler during init gives a dependency
# loop
yield
self
.
hs
.
get_room_creation_handler
().
create_room
(
fake_requester
,
config
=
{
"
preset
"
:
"
public_chat
"
,
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/room.py
+
3
−
6
View file @
7f7b2cd3
...
...
@@ -73,6 +73,7 @@ class RoomCreationHandler(BaseHandler):
self
.
spam_checker
=
hs
.
get_spam_checker
()
self
.
event_creation_handler
=
hs
.
get_event_creation_handler
()
self
.
room_member_handler
=
hs
.
get_room_member_handler
()
@defer.inlineCallbacks
def
create_room
(
self
,
requester
,
config
,
ratelimit
=
True
,
...
...
@@ -195,12 +196,9 @@ class RoomCreationHandler(BaseHandler):
# override any attempt to set room versions via the creation_content
creation_content
[
"
room_version
"
]
=
room_version
room_member_handler
=
self
.
hs
.
get_room_member_handler
()
yield
self
.
_send_events_for_new_room
(
requester
,
room_id
,
room_member_handler
,
preset_config
=
preset_config
,
invite_list
=
invite_list
,
initial_state
=
initial_state
,
...
...
@@ -242,7 +240,7 @@ class RoomCreationHandler(BaseHandler):
if
is_direct
:
content
[
"
is_direct
"
]
=
is_direct
yield
room_member_handler
.
update_membership
(
yield
self
.
room_member_handler
.
update_membership
(
requester
,
UserID
.
from_string
(
invitee
),
room_id
,
...
...
@@ -280,7 +278,6 @@ class RoomCreationHandler(BaseHandler):
self
,
creator
,
# A Requester object.
room_id
,
room_member_handler
,
preset_config
,
invite_list
,
initial_state
,
...
...
@@ -325,7 +322,7 @@ class RoomCreationHandler(BaseHandler):
content
=
creation_content
,
)
yield
room_member_handler
.
update_membership
(
yield
self
.
room_member_handler
.
update_membership
(
creator
,
creator
.
user
,
room_id
,
...
...
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