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
Container Registry
Model registry
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
Maunium
synapse
Commits
0287d033
Commit
0287d033
authored
5 years ago
by
Andrew Morgan
Browse files
Options
Downloads
Patches
Plain Diff
Transfer upgraded rooms on groups
parent
cc6243b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/6235.bugfix
+1
-0
1 addition, 0 deletions
changelog.d/6235.bugfix
synapse/handlers/room_member.py
+9
-0
9 additions, 0 deletions
synapse/handlers/room_member.py
synapse/storage/data_stores/main/group_server.py
+15
-0
15 additions, 0 deletions
synapse/storage/data_stores/main/group_server.py
with
25 additions
and
0 deletions
changelog.d/6235.bugfix
0 → 100644
+
1
−
0
View file @
0287d033
Remove a room from a server's public rooms list on room upgrade.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
synapse/handlers/room_member.py
+
9
−
0
View file @
0287d033
...
...
@@ -514,6 +514,15 @@ class RoomMemberHandler(object):
if
old_room
and
old_room
[
"
is_public
"
]:
yield
self
.
store
.
set_room_is_public
(
old_room_id
,
False
)
yield
self
.
store
.
set_room_is_public
(
room_id
,
True
)
# Check if any groups we own contain the predecessor room
local_group_ids
=
yield
self
.
store
.
get_local_groups_for_room
(
old_room_id
)
for
group_id
in
local_group_ids
:
# Add new the new room to those groups
yield
self
.
store
.
add_room_to_group
(
group_id
,
room_id
,
old_room
[
"
is_public
"
])
# Remove the old room from those groups
yield
self
.
store
.
remove_room_from_group
(
group_id
,
old_room_id
)
@defer.inlineCallbacks
def
copy_user_state_on_room_upgrade
(
self
,
old_room_id
,
new_room_id
,
user_ids
):
...
...
This diff is collapsed.
Click to expand it.
synapse/storage/data_stores/main/group_server.py
+
15
−
0
View file @
0287d033
...
...
@@ -552,6 +552,21 @@ class GroupServerStore(SQLBaseStore):
keyvalues
=
{
"
group_id
"
:
group_id
,
"
role_id
"
:
role_id
,
"
user_id
"
:
user_id
},
desc
=
"
remove_user_from_summary
"
,
)
def
get_local_groups_for_room
(
self
,
room_id
):
"""
Get all of the local group that contain a given room
Args:
room_id (str): The ID of a room
Returns:
Deferred[list[str]]: A twisted.Deferred containing a list of group ids
containing this room
"""
return
self
.
_simple_select_onecol
(
table
=
"
group_rooms
"
,
keyvalues
=
{
"
room_id
"
:
room_id
},
retcol
=
"
group_id
"
,
desc
=
"
get_local_groups_for_room
"
,
)
def
get_users_for_summary_by_role
(
self
,
group_id
,
include_private
=
False
):
"""
Get the users and roles that should be included in a summary request
...
...
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