[imp] Suggestion: Drafts
Ahmed
ashihab@alcahest.com
Tue, 19 Feb 2002 12:25:55 +0000
Thanks Jan.
I've made the mods to my system, seems to work fine. If anyone else
is interested here are the patches:
imp/config/prefs.php:
----------------------------- snip --------------------------
--- prefs.php.dist Tue Feb 19 09:27:06 2002
+++ prefs.php Tue Feb 19 12:11:56 2002
@@ -72,7 +72,7 @@
'label' => _("Message Composition"),
'desc' => _("Customize how you send mail and where drafts are
saved."),
'members' => array
('wrap_width', 'reply_quote', 'quote_prefix', 'compose_popup',
-
'folderselect', 'drafts_folder', 'close_draft')
+ 'folderselect', 'drafts_folder', 'close_draft'
, 'seen_drafts')
);
$prefGroups['logintasks'] = array(
@@ -439,6 +439,15 @@
'desc' => _("Compose messages in a separate window.")
);
+// save drafts as seen or unseen
+$_prefs['seen_drafts'] = array(
+ 'value' => 0,
+ 'locked' => false,
+ 'shared' => false,
+ 'type' => 'checkbox',
+ 'desc' => _("Save Drafts as seen.")
+);
+
// addressbook selection widget
$_prefs['sourceselect'] = array('type' => 'special');
----------------------------- snip --------------------------
change to imp/compose.php
----------------------------- snip --------------------------
--- compose.php Tue Feb 19 12:24:33 2002
+++ compose.php.new Tue Feb 19 12:13:37 2002
@@ -909,7 +909,12 @@
$body = preg_replace("|([^\r])\n|", "\\1\r\n", $body);
$body = str_replace("\n\n", "\n\r\n", $body);
- $append_flags = '\\Draft \\Seen';
+ if ($prefs->getValue('seen_drafts')) {
+ $append_flags = '\\Draft \\Seen';
+ } else {
+ $append_flags = '\\Draft';
+ }
+
if (IMP_Folder::exists($imp['stream'], $drafts_folder) ||
IMP_Folder::create($imp['stream'], $drafts_folder,
$prefs->getValue('subscribe'))) {
if (!@imap_append($imp['stream'], IMP::serverString() .
imap_utf7_encode($drafts_folder), $body, $append_flags)) {
----------------------------- snip --------------------------
Ahmed...
>
> That's not so hard to do. Add a preference like:
>
> $_prefs['seen_drafts'] = array(
> 'value' => 0,
> 'locked' => false,
> 'shared' => false,
> 'type' => 'checkbox',
> 'desc' => _("Save Drafts as seen.")
> );
>
> Add 'seen_draft' to one of the preferences groups and add the seen
> flag in
> compose.php in a conditional:
>
> if ($prefs->getValue('seen_drafts'))
>