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
f61b2068
Commit
f61b2068
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Only fetch aliases when publishing rooms
parent
f666fe36
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/directory.py
+15
-15
15 additions, 15 deletions
synapse/handlers/directory.py
with
15 additions
and
15 deletions
synapse/handlers/directory.py
+
15
−
15
View file @
f61b2068
...
...
@@ -417,22 +417,22 @@ class DirectoryHandler(BaseHandler):
yield
self
.
auth
.
check_can_change_room_list
(
room_id
,
requester
.
user
)
room_aliases
=
yield
self
.
store
.
get_aliases_for_room
(
room_id
)
canonical_alias
=
yield
self
.
store
.
get_canonical_alias_for_room
(
room_id
)
if
canonical_alias
:
room_aliases
.
append
(
canonical_alias
)
making_public
=
visibility
==
"
public
"
if
making_public
and
not
self
.
config
.
is_publishing_room_allowed
(
user_id
,
room_id
,
room_aliases
,
):
# Lets just return a generic message, as there may be all sorts of
# reasons why we said no. TODO: Allow configurable error messages
# per alias creation rule?
raise
SynapseError
(
403
,
"
Not allowed to publish room
"
,
)
if
making_public
:
room_aliases
=
yield
self
.
store
.
get_aliases_for_room
(
room_id
)
canonical_alias
=
yield
self
.
store
.
get_canonical_alias_for_room
(
room_id
)
if
canonical_alias
:
room_aliases
.
append
(
canonical_alias
)
if
not
self
.
config
.
is_publishing_room_allowed
(
user_id
,
room_id
,
room_aliases
,
):
# Lets just return a generic message, as there may be all sorts of
# reasons why we said no. TODO: Allow configurable error messages
# per alias creation rule?
raise
SynapseError
(
403
,
"
Not allowed to publish room
"
,
)
yield
self
.
store
.
set_room_is_public
(
room_id
,
making_public
)
...
...
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