mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 15:26:10 -04:00
Automatically delete empty groups/communities (#6453)
Signed-off-by: Werner Sembach <werner.sembach@fau.de>
This commit is contained in:
parent
0b90fc6ed2
commit
9d173b312c
4 changed files with 38 additions and 0 deletions
|
@ -773,6 +773,11 @@ class GroupsServerHandler(object):
|
|||
if not self.hs.is_mine_id(user_id):
|
||||
yield self.store.maybe_delete_remote_profile_cache(user_id)
|
||||
|
||||
# Delete group if the last user has left
|
||||
users = yield self.store.get_users_in_group(group_id, include_private=True)
|
||||
if not users:
|
||||
yield self.store.delete_group(group_id)
|
||||
|
||||
return {}
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue