synapse/groups/groups_server.py
def remove_user_from_group(self, group_id, user_id, requester_user_id, content):
        """Remove a user from the group; either a user is leaving or an admin
        kicked them.
        """

        yield self.check_group_is_ours(group_id, requester_user_id, and_exists=True)

        is_kick = False
        if requester_user_id != user_id:
            is_admin = yield self.store.is_user_admin_in_group(
                group_id, requester_user_id
            )
            if not is_admin:
                raise SynapseError(403, "User is not admin in group")

            is_kick = True

        yield self.store.remove_user_from_group(
            group_id, user_id,
        )

        if is_kick:
            if self.hs.is_mine_id(user_id):
                groups_local = self.hs.get_groups_local_handler()
                yield groups_local.user_removed_from_group(group_id, user_id, {})
            else:
                yield self.transport_client.remove_user_from_group_notification(
                    get_domain_from_id(user_id), group_id, user_id, {}
                )

        if not self.hs.is_mine_id(user_id):
            yield self.store.maybe_delete_remote_profile_cache(user_id)

        defer.returnValue({})
Remove a user from the group; either a user is leaving or an admin
        kicked them.
        
Remove a user from the group; either a user is leaving or an admin
kicked them.
Remove a user from the group ; either a user is leaving or an admin kicked them .
def remove_user_from_group(self, group_id, user_id, requester_user_id, content):
        yield self.check_group_is_ours(group_id, requester_user_id, and_exists=True)
        is_kick = False
        if requester_user_id != user_id:
            is_admin = yield self.store.is_user_admin_in_group(
                group_id, requester_user_id
            )
            if not is_admin:
                raise SynapseError(403, "User is not admin in group")
            is_kick = True
        yield self.store.remove_user_from_group(
            group_id, user_id,
        )
        if is_kick:
            if self.hs.is_mine_id(user_id):
                groups_local = self.hs.get_groups_local_handler()
                yield groups_local.user_removed_from_group(group_id, user_id, {})
            else:
                yield self.transport_client.remove_user_from_group_notification(
                    get_domain_from_id(user_id), group_id, user_id, {}
                )
        if not self.hs.is_mine_id(user_id):
            yield self.store.maybe_delete_remote_profile_cache(user_id)
        defer.returnValue({})
def remove_user_from_group ( self , group_id , user_id , requester_user_id , content ) : yield self . check_group_is_ours ( group_id , requester_user_id , and_exists = True ) is_kick = False if requester_user_id != user_id : is_admin = yield self . store . is_user_admin_in_group ( group_id , requester_user_id ) if not is_admin : raise SynapseError ( 403 , "User is not admin in group" ) is_kick = True yield self . store . remove_user_from_group ( group_id , user_id , ) if is_kick : if self . hs . is_mine_id ( user_id ) : groups_local = self . hs . get_groups_local_handler ( ) yield groups_local . user_removed_from_group ( group_id , user_id , { } ) else : yield self . transport_client . remove_user_from_group_notification ( get_domain_from_id ( user_id ) , group_id , user_id , { } ) if not self . hs . is_mine_id ( user_id ) : yield self . store . maybe_delete_remote_profile_cache ( user_id ) defer . returnValue ( { } )
Remove a user from the group; either a user is leaving or an admin
kicked them.
Remove a user from the group ; either a user is leaving or an admin kicked them .
"""Remove a user from the group; either a user is leaving or an admin
        kicked them.
        """
self
group_id
user_id
requester_user_id
content