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
7a1af504
Commit
7a1af504
authored
6 years ago
by
David Baker
Browse files
Options
Downloads
Patches
Plain Diff
Remove users from user directory on deactivate
parent
f72d5a44
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/handlers/deactivate_account.py
+4
-0
4 additions, 0 deletions
synapse/handlers/deactivate_account.py
synapse/handlers/user_directory.py
+7
-0
7 additions, 0 deletions
synapse/handlers/user_directory.py
with
11 additions
and
0 deletions
synapse/handlers/deactivate_account.py
+
4
−
0
View file @
7a1af504
...
@@ -30,6 +30,7 @@ class DeactivateAccountHandler(BaseHandler):
...
@@ -30,6 +30,7 @@ class DeactivateAccountHandler(BaseHandler):
self
.
_auth_handler
=
hs
.
get_auth_handler
()
self
.
_auth_handler
=
hs
.
get_auth_handler
()
self
.
_device_handler
=
hs
.
get_device_handler
()
self
.
_device_handler
=
hs
.
get_device_handler
()
self
.
_room_member_handler
=
hs
.
get_room_member_handler
()
self
.
_room_member_handler
=
hs
.
get_room_member_handler
()
self
.
user_directory_handler
=
hs
.
get_user_directory_handler
()
# Flag that indicates whether the process to part users from rooms is running
# Flag that indicates whether the process to part users from rooms is running
self
.
_user_parter_running
=
False
self
.
_user_parter_running
=
False
...
@@ -65,6 +66,9 @@ class DeactivateAccountHandler(BaseHandler):
...
@@ -65,6 +66,9 @@ class DeactivateAccountHandler(BaseHandler):
# removal from all the rooms they're a member of)
# removal from all the rooms they're a member of)
yield
self
.
store
.
add_user_pending_deactivation
(
user_id
)
yield
self
.
store
.
add_user_pending_deactivation
(
user_id
)
# delete from user directory
yield
self
.
user_directory_handler
.
handle_user_deactivated
(
user_id
)
# Now start the process that goes through that list and
# Now start the process that goes through that list and
# parts users from rooms (if it isn't already running)
# parts users from rooms (if it isn't already running)
self
.
_start_user_parting
()
self
.
_start_user_parting
()
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/user_directory.py
+
7
−
0
View file @
7a1af504
...
@@ -122,6 +122,13 @@ class UserDirectoryHandler(object):
...
@@ -122,6 +122,13 @@ class UserDirectoryHandler(object):
user_id
,
profile
.
display_name
,
profile
.
avatar_url
,
None
,
user_id
,
profile
.
display_name
,
profile
.
avatar_url
,
None
,
)
)
@defer.inlineCallbacks
def
handle_user_deactivated
(
self
,
user_id
):
"""
Called when a user ID is deactivated
"""
yield
self
.
store
.
remove_from_user_dir
(
user_id
)
yield
self
.
store
.
remove_from_user_in_public_room
(
user_id
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
_unsafe_process
(
self
):
def
_unsafe_process
(
self
):
# If self.pos is None then means we haven't fetched it from DB
# If self.pos is None then means we haven't fetched it from DB
...
...
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