Hi,
 
I'm trying to modify mboxlist.c to check for the sharedseen flag of a folder 
during subfolder creation, so to set it to true automatically when the parent 
is true.
I'm having trouble reading the attrib, I made this function:

static int _mbe_has_sharedseen(const mbentry_t *mbentry, const char *entry)
{
    syslog(LOG_DEBUG, "TEST: _mbe_has_sharedseen [name: '%s', uniqueid: '%s', 
entry: '%s']", mbentry->name, mbentry->uniqueid, entry);
    struct buf attrib = BUF_INITIALIZER;
    int res = 0;
    char *dbname = mboxname_to_dbname(mbentry->name);
    syslog(LOG_DEBUG, "TEST: _mbe_has_sharedseen [dbname: '%s']", dbname);
    annotatemore_lookup_mbe(mbentry, entry, "", &attrib);
//    annotatemore_lookup(dbname, entry, "", &attrib);
    if (buf_len(&attrib)) {
        syslog(LOG_DEBUG, "TEST: attrib.len ok");
        strarray_t *val = strarray_split(buf_cstring(&attrib), NULL, 0);
        syslog(LOG_DEBUG, "TEST: after strarray_splite ['%s']", val);
        if (strarray_contains_case(val, "true")) {
            syslog(LOG_DEBUG, "TEST: value is true");
            res = 1;
        }
        strarray_free(val);
    }
    buf_free(&attrib);
    free(dbname);
    return res;
}

and call it like this: 

_mbe_has_sharedseen(p_mbentry, "/shared" IMAP_ANNOT_NS "sharedseen")

but it's alway returning false, as if annotatemore_lookup_mbe produces alwats a 
"buf_len(&attrib)" of 0.
What's wrong with my call to annotatemore_lookup_mbe?

Thanks for any help,



Gabriele
 
 
Sonicle S.r.l. : http://www.sonicle.com
Music: http://www.gabrielebulfon.com
eXoplanets : https://gabrielebulfon.bandcamp.com/album/exoplanets
 


------------------------------------------
Cyrus: Info
Permalink: 
https://cyrus.topicbox.com/groups/info/T150d344237b2338e-M84feeda33cdb389c6626beb1
Delivery options: https://cyrus.topicbox.com/groups/info/subscription

Reply via email to