def check_faces_in_caption(photo):
    """Checks if all faces are mentioned in the caption."""
    comment = photo.comment
    if photo.getfaces() and not comment:
        return False
    for face in photo.getfaces():
        parts = face.split(" ")
        # Look for the full name or just the first name.
        if (comment.find(face) == -1 and
            (len(parts) <= 1 or comment.find(parts[0]) == -1)):
            return False
    return True