EXPORTED int mailbox_internal_seen(const struct mailbox *mailbox, const char *userid)
{
    /* old mailboxes don't have internal seen at all */
    if (mailbox->i.minor_version < 12)
        return 0;

    /* shared seen - everyone's state is internal */
    if (mailbox->i.options & OPT_IMAP_SHAREDSEEN)
        return 1;

    /* no username => use internal as well */
    if (!userid)
        return 1;

    /* otherwise the owner's seen state is internal */
    return mboxname_userownsmailbox(userid, mailbox_name(mailbox));
}
EXPORTED int mailbox_internal_seen(const struct mailbox *mailbox, const char *userid)
{
     
    if (mailbox->i.minor_version < 12)
        return 0;

     
    if (mailbox->i.options & OPT_IMAP_SHAREDSEEN)
        return 1;

     
    if (!userid)
        return 1;

     
    return mboxname_userownsmailbox(userid, mailbox_name(mailbox));
}