
/*
 * seq_setcur.c -- set the current "cur" message for a folder
 *
 * $Id$
 */

#include <h/mh.h>


void
seq_setcur (struct msgs *mp, int msgnum)
{
    int i, public;

    public = mp->msgflags & READONLY ? 0 : 1;

    for (i = 0; mp->msgattrs[i]; i++)
	if (!strcmp (mp->msgattrs[i], current)) {
	    public = is_seq_private (mp, i) ? 0 : 1;
	    break;
	}

    /* update "cur" sequence */
    seq_addmsg (mp, current, msgnum, public, 1);
}
