1: <?php
2: /**
3: * Copyright 2013-2014 Horde LLC (http://www.horde.org/)
4: *
5: * See the enclosed file COPYING for license information (GPL). If you
6: * did not receive this file, see http://www.horde.org/licenses/gpl.
7: *
8: * @category Horde
9: * @copyright 2013-2014 Horde LLC
10: * @license http://www.horde.org/licenses/gpl GPL
11: * @package IMP
12: */
13:
14: /**
15: * This class contains code related to generating and handling a mailbox
16: * message list for POP3 servers.
17: *
18: * @author Michael Slusarz <slusarz@horde.org>
19: * @category Horde
20: * @copyright 2013-2014 Horde LLC
21: * @license http://www.horde.org/licenses/gpl GPL
22: * @package IMP
23: */
24: class IMP_Mailbox_List_Pop3 extends IMP_Mailbox_List
25: {
26: /**
27: */
28: public function removeMsgs($indices)
29: {
30: if (!parent::removeMsgs($indices)) {
31: return false;
32: }
33:
34: foreach ($indices as $ob) {
35: foreach ($ob->uids as $uid) {
36: if (($aindex = array_search($uid, $this->_buids)) !== false) {
37: unset($this->_buids[$aindex]);
38: }
39: }
40: }
41:
42: return true;
43: }
44:
45: /**
46: */
47: public function getBuid($mbox, $uid)
48: {
49: // Ignore $mbox
50:
51: if (($aindex = array_search($uid, $this->_buids)) === false) {
52: $aindex = ++$this->_buidmax;
53: $this->_buids[$aindex] = $uid;
54: $this->changed = true;
55: }
56:
57: return $aindex;
58: }
59:
60: /**
61: */
62: public function resolveBuid($buid)
63: {
64: if (!isset($this->_buids[$buid])) {
65: return null;
66: }
67:
68: return array(
69: 'm' => $this->_mailbox,
70: 'u' => $this->_buids[$buid]
71: );
72: }
73:
74: }
75: