This function doesn't match the output for this "Name: david
------------------------------------------
Friends:
bogdan
michelle
------------------------------------------
Posts:
From: michelle
Date: Fri Jan 27 14:40:07 2023

Isn't 209 fun?

===

From: bogdan
Date: Fri Jan 27 14:40:07 2023

david is soooo cool :)
------------------------------------------"
int make_friends(const char *name1, const char *name2, User *head) {
    User *user1 = find_user(name1, head);
    User *user2 = find_user(name2, head);

    if ((user1 == NULL) || (user2 == NULL)) {
        // if at least one user does not exist.
        return 4;
    }

    if (user1 == user2) {
        // if the same user is passed in twice.
        return 3;
    }

    if (is_full(user1) || is_full(user2)) {
        // if the users are not already friends, but at least one already has
        // MAX_FRIENDS friends.
        return 2;
    }

    if (already_friends(user1, user2) == 0) {
        // if the two users are already friends.
        return 1;
    }

    int i = 0;
    while (i < MAX_FRIENDS && user1->friends[i]) {
        i++;
    }
    user1->friends[i] = user2;

    i = 0;
    while (i < MAX_FRIENDS && user2->friends[i]) {
        i++;
    }
    user2->friends[i] = user1;

    return 0;
}


/*
 * Print a user profile.
 * For an example of the required output format, see the example output
 * linked from the handout.
 * Return:
 *   - 0 on success.
 *   - 1 if the user is NULL.
 */
int print_user(const User *user) {
    if (user == NULL) {
        // if the user is NULL
        return -1;
    }

    if (strcmp(user->profile_pic, "\0") != 0){
        // if user has profile picture, print picture
    }

    printf("Name: %s\n", user->name);
    printf("------------------------------------------\n");

    // Print list of friends
    printf("Friends:\n");
    int i = 0;
    while (i < MAX_FRIENDS && user->friends[i]) {
        printf("%s\n", user->friends[i]->name);
        i++;
    }
    printf("------------------------------------------\n");
    
    // Print list of posts
    printf("Posts:\n");
    printf("------------------------------------------\n");
    Post *current_post = user->first_post;
    while (current_post != NULL) {
        printf("From: %s\n", current_post->author);
        printf("Date: %s", ctime(current_post->date));
        printf("\n%s\n\n", current_post->contents);
        printf("===", current_post->contents);
        current_post = current_post->next;
    }
    return 0;
}
