
/*
 * m_setcur.c -- set "cur"
 *
 * $Id$
 */

#include <h/mh.h>


void
m_setcur (struct msgs *mp, int num)
{
    int i, public;

    public = !(mp->msgflags & READONLY);
    for (i = 0; mp->msgattrs[i]; i++)
	if (!strcmp (mp->msgattrs[i], current)) {
	    public = !(mp->attrstats & (1 << (FFATTRSLOT + i)));
	    break;
	}

    if (!m_seqnew (mp, current, public))
	return;
    m_seqadd (mp, current, mp->curmsg = num, public);
}
