[Svn] r2826 - in trunk/roundcubemail/program: include lib

trac at roundcube.net trac at roundcube.net
Sun Aug 2 09:54:10 CEST 2009


Author: alec
Date: 2009-08-02 02:54:10 -0500 (Sun, 02 Aug 2009)
New Revision: 2826

Modified:
   trunk/roundcubemail/program/include/rcube_imap.php
   trunk/roundcubemail/program/lib/imap.inc
Log:
- Add rcube_imap::unset_flag (#1486017)


Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2009-08-01 10:20:09 UTC (rev 2825)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2009-08-02 07:54:10 UTC (rev 2826)
@@ -1534,12 +1534,8 @@
     if (!is_array($uids))
       $uids = explode(',',$uids);
       
-    if ($flag=='UNDELETED')
-      $result = iil_C_Undelete($this->conn, $mailbox, join(',', $uids));
-    else if ($flag=='UNSEEN')
-      $result = iil_C_Unseen($this->conn, $mailbox, join(',', $uids));
-    else if ($flag=='UNFLAGGED')
-      $result = iil_C_UnFlag($this->conn, $mailbox, join(',', $uids), 'FLAGGED');
+    if (strpos($flag, 'UN') === 0)
+      $result = iil_C_UnFlag($this->conn, $mailbox, join(',', $uids), substr($flag, 2));
     else
       $result = iil_C_Flag($this->conn, $mailbox, join(',', $uids), $flag);
 
@@ -1570,6 +1566,21 @@
 
 
   /**
+   * Remove message flag for one or several messages
+   *
+   * @param mixed  Message UIDs as array or as comma-separated string
+   * @param string Flag to unset: SEEN, DELETED, RECENT, ANSWERED, DRAFT, MDNSENT
+   * @param string Folder name
+   * @return boolean True on success, False on failure
+   * @see set_flag
+   */
+  function unset_flag($uids, $flag, $mbox_name=NULL)
+    {
+    return $this->set_flag($uids, 'UN'.$flag, $mbox_name);
+    }
+
+
+  /**
    * Append a mail message (source) to a specific mailbox
    *
    * @param string Target mailbox

Modified: trunk/roundcubemail/program/lib/imap.inc
===================================================================
--- trunk/roundcubemail/program/lib/imap.inc	2009-08-01 10:20:09 UTC (rev 2825)
+++ trunk/roundcubemail/program/lib/imap.inc	2009-08-02 07:54:10 UTC (rev 2826)
@@ -1813,14 +1813,6 @@
 	return iil_C_ModFlag($conn, $mailbox, $messages, 'DELETED', '+');
 }
 
-function iil_C_Undelete(&$conn, $mailbox, $messages) {
-	return iil_C_ModFlag($conn, $mailbox, $messages, 'DELETED', '-');
-}
-
-function iil_C_Unseen(&$conn, $mailbox, $messages) {
-	return iil_C_ModFlag($conn, $mailbox, $messages, 'SEEN', '-');
-}
-
 function iil_C_Copy(&$conn, $messages, $from, $to) {
 	$fp = $conn->fp;
 

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



More information about the Svn mailing list