use mailbox_save_attributes(). Implemented "hold" variable. Raise MU_ATTRIBUTE_R…
…EAD on every message with MU_ATTRIBUTE_SEEN
Showing
1 changed file
with
6 additions
and
3 deletions
... | @@ -39,6 +39,7 @@ mail_mbox_close () | ... | @@ -39,6 +39,7 @@ mail_mbox_close () |
39 | if (mail_mbox_commit ()) | 39 | if (mail_mbox_commit ()) |
40 | return 1; | 40 | return 1; |
41 | 41 | ||
42 | mailbox_save_attributes (mbox); | ||
42 | mailbox_expunge (mbox); | 43 | mailbox_expunge (mbox); |
43 | 44 | ||
44 | mailbox_get_url (mbox, &url); | 45 | mailbox_get_url (mbox, &url); |
... | @@ -59,6 +60,7 @@ mail_mbox_commit () | ... | @@ -59,6 +60,7 @@ mail_mbox_commit () |
59 | message_t msg; | 60 | message_t msg; |
60 | attribute_t attr; | 61 | attribute_t attr; |
61 | int keepsave = util_find_env("keepsave")->set; | 62 | int keepsave = util_find_env("keepsave")->set; |
63 | int hold = util_find_env ("hold")->set; | ||
62 | 64 | ||
63 | for (i = 1; i <= total; i++) | 65 | for (i = 1; i <= total; i++) |
64 | { | 66 | { |
... | @@ -68,7 +70,8 @@ mail_mbox_commit () | ... | @@ -68,7 +70,8 @@ mail_mbox_commit () |
68 | return 1; | 70 | return 1; |
69 | } | 71 | } |
70 | message_get_attribute (msg, &attr); | 72 | message_get_attribute (msg, &attr); |
71 | if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_MBOXED)) | 73 | if (attribute_is_userflag (attr, MAIL_ATTRIBUTE_MBOXED) |
74 | || (!hold && attribute_is_seen (attr))) | ||
72 | { | 75 | { |
73 | if (!dest_mbox) | 76 | if (!dest_mbox) |
74 | { | 77 | { |
... | @@ -88,9 +91,9 @@ mail_mbox_commit () | ... | @@ -88,9 +91,9 @@ mail_mbox_commit () |
88 | saved_count++; | 91 | saved_count++; |
89 | } | 92 | } |
90 | else if (!keepsave && attribute_is_userflag (attr, MAIL_ATTRIBUTE_SAVED)) | 93 | else if (!keepsave && attribute_is_userflag (attr, MAIL_ATTRIBUTE_SAVED)) |
91 | { | ||
92 | attribute_set_deleted (attr); | 94 | attribute_set_deleted (attr); |
93 | } | 95 | else if (attribute_is_seen (attr)) |
96 | attribute_set_read (attr); | ||
94 | } | 97 | } |
95 | 98 | ||
96 | if (saved_count) | 99 | if (saved_count) | ... | ... |
-
Please register or sign in to post a comment