summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-08-02 07:54:10 +0000
committeralecpl <alec@alec.pl>2009-08-02 07:54:10 +0000
commit78c7947bf8820aba5d45787883a4e7780854f628 (patch)
tree3794e2f9a1bfcca77f25bb37da7747e9459b174d /program
parent1fcad15e7534e0cfe49435c9f8abf116ad0b1e01 (diff)
- Add rcube_imap::unset_flag (#1486017)
Diffstat (limited to 'program')
-rw-r--r--program/include/rcube_imap.php23
-rw-r--r--program/lib/imap.inc8
2 files changed, 17 insertions, 14 deletions
diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php
index 5b5a98ceb..aaa77849d 100644
--- a/program/include/rcube_imap.php
+++ b/program/include/rcube_imap.php
@@ -1534,12 +1534,8 @@ class rcube_imap
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 @@ class rcube_imap
/**
+ * 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
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 7fb63c9ff..f06767570 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -1813,14 +1813,6 @@ function iil_C_Delete(&$conn, $mailbox, $messages) {
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;