Changeset 93272ea in github
- Timestamp:
- Oct 29, 2010 8:41:11 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 9ae29c9
- Parents:
- c309cd8
- Location:
- program/include
- Files:
-
- 2 edited
-
rcube_imap.php (modified) (4 diffs)
-
rcube_imap_generic.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/include/rcube_imap.php
rc309cd8 r93272ea 2475 2475 2476 2476 // move messages 2477 $move = $this->conn->move($uids, $from_mbox, $to_mbox); 2478 $moved = !($move === false || $move < 0); 2477 $moved = $this->conn->move($uids, $from_mbox, $to_mbox); 2479 2478 2480 2479 // send expunge command in order to have the moved message … … 2537 2536 2538 2537 // exit if no message uids are specified 2539 if (empty($uids)) 2538 if (empty($uids)) { 2540 2539 return false; 2540 } 2541 2541 2542 2542 // make sure mailbox exists … … 2549 2549 2550 2550 // copy messages 2551 $copy = $this->conn->copy($uids, $from_mbox, $to_mbox); 2552 $copied = !($copy === false || $copy < 0); 2551 $copied = $this->conn->copy($uids, $from_mbox, $to_mbox); 2553 2552 2554 2553 if ($copied) { … … 3651 3650 return $cache_count ? -2 : 1; 3652 3651 3653 if ($cache_count ==$msg_count) {3652 if ($cache_count == $msg_count) { 3654 3653 if ($this->skip_deleted) { 3655 3654 $h_index = $this->conn->fetchHeaderIndex($mailbox, "1:*", 'UID', $this->skip_deleted); -
program/include/rcube_imap_generic.php
rc309cd8 r93272ea 1200 1200 } 1201 1201 1202 function UID2ID($folder, $uid) 1202 /** 1203 * Returns message sequence identifier 1204 * 1205 * @param string $mailbox Mailbox name 1206 * @param int $uid Message unique identifier (UID) 1207 * 1208 * @return int Message sequence identifier 1209 * @access public 1210 */ 1211 function UID2ID($mailbox, $uid) 1203 1212 { 1204 1213 if ($uid > 0) { 1205 $id_a = $this->search($ folder, "UID $uid");1214 $id_a = $this->search($mailbox, "UID $uid"); 1206 1215 if (is_array($id_a) && count($id_a) == 1) { 1207 return $id_a[0];1216 return (int) $id_a[0]; 1208 1217 } 1209 1218 } 1210 return false; 1211 } 1212 1213 function ID2UID($folder, $id) 1214 { 1215 if (empty($id)) { 1216 return -1; 1219 return null; 1220 } 1221 1222 /** 1223 * Returns message unique identifier (UID) 1224 * 1225 * @param string $mailbox Mailbox name 1226 * @param int $uid Message sequence identifier 1227 * 1228 * @return int Message unique identifier 1229 * @access public 1230 */ 1231 function ID2UID($mailbox, $id) 1232 { 1233 if (empty($id) || $id < 0) { 1234 return null; 1217 1235 } 1218 1236 1219 1237 if (!$this->select($folder)) { 1220 return -1; 1221 } 1222 1223 $result = -1; 1238 return null; 1239 } 1240 1224 1241 list($code, $response) = $this->execute('FETCH', array($id, '(UID)')); 1225 1242 1226 1243 if ($code == self::ERROR_OK && preg_match("/^\* $id FETCH \(UID (.*)\)/i", $response, $m)) { 1227 $result =$m[1];1228 } 1229 1230 return $result;1244 return (int) $m[1]; 1245 } 1246 1247 return null; 1231 1248 } 1232 1249 … … 1616 1633 { 1617 1634 if (empty($from) || empty($to)) { 1618 return -1;1635 return false; 1619 1636 } 1620 1637 1621 1638 if (!$this->select($from)) { 1622 return -1;1639 return false; 1623 1640 } 1624 1641 … … 1627 1644 self::COMMAND_NORESPONSE); 1628 1645 1629 return $result; 1646 return ($result == self::ERROR_OK); 1647 } 1648 1649 function move($messages, $from, $to) 1650 { 1651 if (!$from || !$to) { 1652 return false; 1653 } 1654 1655 $r = $this->copy($messages, $from, $to); 1656 1657 if ($r) { 1658 return $this->delete($from, $messages); 1659 } 1660 return $r; 1630 1661 } 1631 1662 … … 1807 1838 } 1808 1839 1809 function move($messages, $from, $to)1810 {1811 if (!$from || !$to) {1812 return -1;1813 }1814 1815 $r = $this->copy($messages, $from, $to);1816 1817 if ($r==0) {1818 return $this->delete($from, $messages);1819 }1820 return $r;1821 }1822 1823 1840 /** 1824 1841 * Returns list of mailboxes
Note: See TracChangeset
for help on using the changeset viewer.
