'We have received a join event for a room. Fully process it and
respond with the current state and auth chains.'

@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
    event.internal_metadata.send_on_behalf_of = origin
    (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)
    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))
    state_ids = context.prev_state_ids.values()
    auth_chain = (yield self.store.get_auth_chain(state_ids))
    state = (yield self.store.get_events(context.prev_state_ids.values()))
    defer.returnValue({'state': state.values(), 'auth_chain': auth_chain})
