浏览代码

Merge branch 'trunk'

Andy 3 年之前
父节点
当前提交
a4419982b5
共有 3 个文件被更改,包括 14 次插入1 次删除
  1. 3 1
      functions/imap_messages.php
  2. 3 0
      include/load_prefs.php
  3. 8 0
      include/options/folder.php

+ 3 - 1
functions/imap_messages.php

@@ -68,7 +68,9 @@ function sqimap_msgs_list_move($imap_stream, $id, $mailbox, $handle_errors = tru
  */
 function sqimap_msgs_list_delete($imap_stream, $mailbox, $id, $bypass_trash=false) {
     // FIXME: Remove globals by introducing an associative array with properties as 4th argument as replacement for the $bypass_trash variable.
-    global $move_to_trash, $trash_folder;
+    global $move_to_trash, $trash_folder, $mark_as_read_upon_delete;
+    if ($mark_as_read_upon_delete)
+        sqimap_toggle_flag($imap_stream, $id, '\\Seen', true, true);
     if (($move_to_trash == true) && ($bypass_trash != true) &&
         (sqimap_mailbox_exists($imap_stream, $trash_folder) &&  ($mailbox != $trash_folder)) ) {
         /**

+ 3 - 0
include/load_prefs.php

@@ -78,6 +78,9 @@ $move_to_trash =
 $save_as_draft =
     getPref($data_dir, $username, 'save_as_draft', $default_save_as_draft);
 
+$mark_as_read_upon_delete =
+    getPref($data_dir, $username, 'mark_as_read_upon_delete', FALSE);
+
 if ($default_unseen_type == '') {
     $default_unseen_type = 1;
 }

+ 8 - 0
include/options/folder.php

@@ -104,6 +104,14 @@ function load_optpage_data_folder() {
         'refresh' => SMOPT_REFRESH_FOLDERLIST
     );
 
+    $optvals[SMOPT_GRP_SPCFOLDER][] = array(
+        'name'    => 'mark_as_read_upon_delete',
+        'caption' => _("Mark Deleted Messages as Read"),
+        'type'    => SMOPT_TYPE_BOOLEAN,
+        'refresh' => SMOPT_REFRESH_NONE
+    );
+
+//TODO: Arguably, this should go in Compose preferences, not here
     $optvals[SMOPT_GRP_SPCFOLDER][] = array(
         'name'    => 'save_reply_with_orig',
         'caption' => _("Save Replies with Original Message"),