[Svn] r2487 - in trunk/roundcubemail: . program/include program/steps/mail

trac at roundcube.net trac at roundcube.net
Fri May 15 15:34:04 CEST 2009


Author: alec
Date: 2009-05-15 08:34:04 -0500 (Fri, 15 May 2009)
New Revision: 2487

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/include/rcube_imap.php
   trunk/roundcubemail/program/steps/mail/compose.inc
   trunk/roundcubemail/program/steps/mail/sendmail.inc
Log:
- Fix Answered/Forwarded flag setting for messages from subfolders


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2009-05-15 10:26:07 UTC (rev 2486)
+++ trunk/roundcubemail/CHANGELOG	2009-05-15 13:34:04 UTC (rev 2487)
@@ -1,6 +1,7 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Fix Answered/Forwarded flag setting for messages in subfolders
 - Fix autocomplete problem with capital letters (#1485792)
 - Support UUencode content encoding (#1485839)
 - Minimize chance of race condition in session handling (#1485659, #1484678)

Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2009-05-15 10:26:07 UTC (rev 2486)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2009-05-15 13:34:04 UTC (rev 2487)
@@ -1518,25 +1518,28 @@
    *
    * @param mixed  Message UIDs as array or as comma-separated string
    * @param string Flag to set: SEEN, UNDELETED, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
+   * @param string Folder name
    * @return boolean True on success, False on failure
    */
-  function set_flag($uids, $flag)
+  function set_flag($uids, $flag, $mbox_name=NULL)
     {
+    $mailbox = $mbox_name ? $this->_mod_mailbox($mbox_name) : $this->mailbox;
+
     $flag = strtoupper($flag);
     if (!is_array($uids))
       $uids = explode(',',$uids);
       
     if ($flag=='UNDELETED')
-      $result = iil_C_Undelete($this->conn, $this->mailbox, join(',', $uids));
+      $result = iil_C_Undelete($this->conn, $mailbox, join(',', $uids));
     else if ($flag=='UNSEEN')
-      $result = iil_C_Unseen($this->conn, $this->mailbox, join(',', $uids));
+      $result = iil_C_Unseen($this->conn, $mailbox, join(',', $uids));
     else if ($flag=='UNFLAGGED')
-      $result = iil_C_UnFlag($this->conn, $this->mailbox, join(',', $uids), 'FLAGGED');
+      $result = iil_C_UnFlag($this->conn, $mailbox, join(',', $uids), 'FLAGGED');
     else
-      $result = iil_C_Flag($this->conn, $this->mailbox, join(',', $uids), $flag);
+      $result = iil_C_Flag($this->conn, $mailbox, join(',', $uids), $flag);
 
     // reload message headers if cached
-    $cache_key = $this->mailbox.'.msg';
+    $cache_key = $mailbox.'.msg';
     if ($this->caching_enabled)
       {
       foreach ($uids as $uid)
@@ -1553,11 +1556,11 @@
 
     // clear message count cache
     if ($result && $flag=='SEEN')
-      $this->_set_messagecount($this->mailbox, 'UNSEEN', $count*(-1));
+      $this->_set_messagecount($mailbox, 'UNSEEN', $count*(-1));
     else if ($result && $flag=='UNSEEN')
-      $this->_set_messagecount($this->mailbox, 'UNSEEN', $count);
+      $this->_set_messagecount($mailbox, 'UNSEEN', $count);
     else if ($result && $flag=='DELETED')
-      $this->_set_messagecount($this->mailbox, 'ALL', $count*(-1));
+      $this->_set_messagecount($mailbox, 'ALL', $count*(-1));
 
     return $result;
     }

Modified: trunk/roundcubemail/program/steps/mail/compose.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/compose.inc	2009-05-15 10:26:07 UTC (rev 2486)
+++ trunk/roundcubemail/program/steps/mail/compose.inc	2009-05-15 13:34:04 UTC (rev 2487)
@@ -35,7 +35,11 @@
 if (!is_array($_SESSION['compose']) || $_SESSION['compose']['id'] != get_input_value('_id', RCUBE_INPUT_GET))
 {
   rcmail_compose_cleanup();
-  $_SESSION['compose'] = array('id' => uniqid(rand()), 'param' => array_map('strip_tags', $_GET));
+  $_SESSION['compose'] = array(
+	'id' => uniqid(rand()),
+	'param' => array_map('strip_tags', $_GET),
+	'mailbox' => $IMAP->get_mailbox_name()
+  );
   
   // process values like "mailto:foo at bar.com?subject=new+message&cc=another"
   if ($_SESSION['compose']['param']['_to']) {
@@ -847,7 +851,7 @@
   if (empty($attrib['name']))
     $attrib['name'] = 'editorSelect';
     
-    $attrib['onchange'] = "return rcmail_toggle_editor(this.value=='html', '".$attrib['editorid']."', '_is_html')";
+  $attrib['onchange'] = "return rcmail_toggle_editor(this.value=='html', '".$attrib['editorid']."', '_is_html')";
 
   $select = new html_select($attrib);
 

Modified: trunk/roundcubemail/program/steps/mail/sendmail.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/sendmail.inc	2009-05-15 10:26:07 UTC (rev 2486)
+++ trunk/roundcubemail/program/steps/mail/sendmail.inc	2009-05-15 13:34:04 UTC (rev 2487)
@@ -432,9 +432,9 @@
   
   // set replied/forwarded flag
   if ($_SESSION['compose']['reply_uid'])
-    $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED');
+    $IMAP->set_flag($_SESSION['compose']['reply_uid'], 'ANSWERED', $_SESSION['compose']['mailbox']);
   else if ($_SESSION['compose']['forward_uid'])
-    $IMAP->set_flag($_SESSION['compose']['forward_uid'], 'FORWARDED');
+    $IMAP->set_flag($_SESSION['compose']['forward_uid'], 'FORWARDED', $_SESSION['compose']['mailbox']);
 
 } // End of SMTP Delivery Block
 

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list