'Returns whether a guest can join a room based on its current state.'

@defer.inlineCallbacks
def _can_guest_join(self, current_state_ids):

    guest_access_id = current_state_ids.get((EventTypes.GuestAccess, ''), None)
    if (not guest_access_id):
        defer.returnValue(False)
    guest_access = (yield self.store.get_event(guest_access_id))
    defer.returnValue((guest_access and guest_access.content and ('guest_access' in guest_access.content) and (guest_access.content['guest_access'] == 'can_join')))
