1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13:
14: 15: 16: 17: 18: 19: 20: 21: 22:
23: class IMP_Maillog_Storage_Mdnsent extends IMP_Maillog_Storage_Base
24: {
25: 26:
27: public function saveLog(
28: IMP_Maillog_Message $msg, IMP_Maillog_Log_Base $log
29: )
30: {
31: global $injector;
32:
33: if (!$msg->indices || ($log->action != 'mdn')) {
34: return false;
35: }
36:
37: list($mbox, $uid) = $msg->indices->getSingle();
38:
39: return $injector->getInstance('IMP_Message')->flag(array(
40: 'add' => array(Horde_Imap_Client::FLAG_MDNSENT)
41: ), $mbox->getIndicesOb($uid), array(
42: 'silent' => true
43: ));
44: }
45:
46: 47:
48: public function getLog(IMP_Maillog_Message $msg, array $filter = array())
49: {
50: if (!$msg->indices || in_array('mdn', $filter)) {
51: return array();
52: }
53:
54: list($mbox, $uid) = $msg->indices->getSingle();
55:
56: if (!$mbox->permflags->allowed(Horde_Imap_Client::FLAG_MDNSENT)) {
57: return array();
58: }
59:
60: $query = new Horde_Imap_Client_Fetch_Query();
61: $query->flags();
62:
63: $imp_imap = $mbox->imp_imap;
64:
65: try {
66: $flags = $imp_imap->fetch($mbox, $query, array(
67: 'ids' => $imp_imap->getIdsOb($uid)
68: ))->first()->getFlags();
69: } catch (IMP_Imap_Exception $e) {
70: $flags = array();
71: }
72:
73: return in_array(Horde_Imap_Client::FLAG_MDNSENT, $flags)
74: ? array(new IMP_Maillog_Log_Mdn())
75: : array();
76: }
77:
78: 79:
80: public function deleteLogs(array $msgs)
81: {
82:
83: }
84:
85: 86:
87: public function getChanges($ts)
88: {
89:
90: return array();
91: }
92:
93: }
94: