synapse/handlers/groups_local.py
def accept_invite(self, group_id, user_id, content):
        """Accept an invite to a group
        """
        if self.is_mine_id(group_id):
            yield self.groups_server_handler.accept_invite(
                group_id, user_id, content
            )
            local_attestation = None
            remote_attestation = None
        else:
            local_attestation = self.attestations.create_attestation(group_id, user_id)
            content["attestation"] = local_attestation

            res = yield self.transport_client.accept_group_invite(
                get_domain_from_id(group_id), group_id, user_id, content,
            )

            remote_attestation = res["attestation"]

            yield self.attestations.verify_attestation(
                remote_attestation,
                group_id=group_id,
                user_id=user_id,
                server_name=get_domain_from_id(group_id),
            )

        # TODO: Check that the group is public and we're being added publically
        is_publicised = content.get("publicise", False)

        token = yield self.store.register_user_group_membership(
            group_id, user_id,
            membership="join",
            is_admin=False,
            local_attestation=local_attestation,
            remote_attestation=remote_attestation,
            is_publicised=is_publicised,
        )
        self.notifier.on_new_event(
            "groups_key", token, users=[user_id],
        )

        defer.returnValue({})
Accept an invite to a group
        
Accept an invite to a group
Accept an invite to a group
def accept_invite(self, group_id, user_id, content):
        if self.is_mine_id(group_id):
            yield self.groups_server_handler.accept_invite(
                group_id, user_id, content
            )
            local_attestation = None
            remote_attestation = None
        else:
            local_attestation = self.attestations.create_attestation(group_id, user_id)
            content["attestation"] = local_attestation
            res = yield self.transport_client.accept_group_invite(
                get_domain_from_id(group_id), group_id, user_id, content,
            )
            remote_attestation = res["attestation"]
            yield self.attestations.verify_attestation(
                remote_attestation,
                group_id=group_id,
                user_id=user_id,
                server_name=get_domain_from_id(group_id),
            )
        is_publicised = content.get("publicise", False)
        token = yield self.store.register_user_group_membership(
            group_id, user_id,
            membership="join",
            is_admin=False,
            local_attestation=local_attestation,
            remote_attestation=remote_attestation,
            is_publicised=is_publicised,
        )
        self.notifier.on_new_event(
            "groups_key", token, users=[user_id],
        )
        defer.returnValue({})
def accept_invite ( self , group_id , user_id , content ) : if self . is_mine_id ( group_id ) : yield self . groups_server_handler . accept_invite ( group_id , user_id , content ) local_attestation = None remote_attestation = None else : local_attestation = self . attestations . create_attestation ( group_id , user_id ) content [ "attestation" ] = local_attestation res = yield self . transport_client . accept_group_invite ( get_domain_from_id ( group_id ) , group_id , user_id , content , ) remote_attestation = res [ "attestation" ] yield self . attestations . verify_attestation ( remote_attestation , group_id = group_id , user_id = user_id , server_name = get_domain_from_id ( group_id ) , ) is_publicised = content . get ( "publicise" , False ) token = yield self . store . register_user_group_membership ( group_id , user_id , membership = "join" , is_admin = False , local_attestation = local_attestation , remote_attestation = remote_attestation , is_publicised = is_publicised , ) self . notifier . on_new_event ( "groups_key" , token , users = [ user_id ] , ) defer . returnValue ( { } )
Accept an invite to a group
Accept an invite to a group
"""Accept an invite to a group
        """ # TODO: Check that the group is public and we're being added publically
self
group_id
user_id
content