static int _too_many_flags(const char *flag, int num)
{
    if (num < 100) return 0;
    if (num >= MAX_USER_FLAGS) return 1;
    int too_many = 1;

    /* check if this is a required user flag */
    const char *val = config_getstring(IMAPOPT_MAILBOX_INITIAL_FLAGS);
    if (val) {
        strarray_t *flags = strarray_split(val, NULL, 0);
        // it's not too many if there's still space and it's an initial flag
        if (strarray_find_case(flags, flag, 0) >= 0)
            too_many = 0;
        strarray_free(flags);
    }

    return too_many;
}
static int _too_many_flags(const char *flag, int num)
{
    if (num < 100) return 0;
    if (num >= MAX_USER_FLAGS) return 1;
    int too_many = 1;

     
    const char *val = config_getstring(IMAPOPT_MAILBOX_INITIAL_FLAGS);
    if (val) {
        strarray_t *flags = strarray_split(val, NULL, 0);
         
        if (strarray_find_case(flags, flag, 0) >= 0)
            too_many = 0;
        strarray_free(flags);
    }

    return too_many;
}