@defer.inlineCallbacks
    @log_function
    def on_send_join_request(self, origin, pdu):
        event = pdu

        logger.debug(
            "on_send_join_request: Got event: %s, signatures: %s",
            event.event_id,
            event.signatures,
        )

        event.internal_metadata.outlier = False

        context, event_stream_id, max_stream_id = yield self._handle_new_event(
            origin, event
        )

        logger.debug(
            "on_send_join_request: After _handle_new_event: %s, sigs: %s",
            event.event_id,
            event.signatures,
        )

        extra_users = []
        if event.type == EventTypes.Member:
            target_user_id = event.state_key
            target_user = UserID.from_string(target_user_id)
            extra_users.append(target_user)

        with PreserveLoggingContext():
            self.notifier.on_new_room_event(
                event, event_stream_id, max_stream_id, extra_users=extra_users
            )

        if event.type == EventTypes.Member:
            if event.content["membership"] == Membership.JOIN:
                user = UserID.from_string(event.state_key)
                yield user_joined_room(self.distributor, user, event.room_id)

        new_pdu = event

        destinations = set()

        for k, s in context.current_state.items():
            try:
                if k[0] == EventTypes.Member:
                    if s.content["membership"] == Membership.JOIN:
                        destinations.add(
                            UserID.from_string(s.state_key).domain
                        )
            except:
                logger.warn(
                    "Failed to get destination from event %s", s.event_id
                )

        destinations.discard(origin)

        logger.debug(
            "on_send_join_request: Sending event: %s, signatures: %s",
            event.event_id,
            event.signatures,
        )

        self.replication_layer.send_pdu(new_pdu, destinations)

        state_ids = [e.event_id for e in context.current_state.values()]
        auth_chain = yield self.store.get_auth_chain(set(
            [event.event_id] + state_ids
        ))

        defer.returnValue({
            "state": context.current_state.values(),
            "auth_chain": auth_chain,
        })
Return a Django form field appropriate for a blob property.
dataset/ETHPy150Open matrix-org/synapse/synapse/handlers/federation.py/FederationHandler.on_send_join_request--crossover with--dataset/ETHPy150Open IanLewis/kay/kay/utils/forms/modelform.py/BlobProperty.get_form_field