Commit 4befbf28 4befbf286418c563dfdd553196e78be7a5169e50 by Sergey Poznyakoff

use mailbox_save_attributes(). Implemented "hold" variable. Raise MU_ATTRIBUTE_R…

…EAD on every message with MU_ATTRIBUTE_SEEN
1 parent 8caa1bc1
......@@ -39,6 +39,7 @@ mail_mbox_close ()
if (mail_mbox_commit ())
return 1;
mailbox_save_attributes (mbox);
mailbox_expunge (mbox);
mailbox_get_url (mbox, &url);
......@@ -59,6 +60,7 @@ mail_mbox_commit ()
message_t msg;
attribute_t attr;
int keepsave = util_find_env("keepsave")->set;
int hold = util_find_env ("hold")->set;
for (i = 1; i <= total; i++)
{
......@@ -68,7 +70,8 @@ mail_mbox_commit ()
return 1;
}
message_get_attribute (msg, &attr);
if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_MBOXED))
if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_MBOXED)
|| (!hold && attribute_is_seen (attr)))
{
if (!dest_mbox)
{
......@@ -88,9 +91,9 @@ mail_mbox_commit ()
saved_count++;
}
else if (!keepsave && attribute_is_userflag (attr, MAIL_ATTRIBUTE_SAVED))
{
attribute_set_deleted (attr);
}
else if (attribute_is_seen (attr))
attribute_set_read (attr);
}
if (saved_count)
......