* email: reuse already fetched flags when checking for MDNsent /MDNnotSend flags;

lots of whitespace removal
This commit is contained in:
Klaus Leithoff 2012-04-17 09:12:01 +00:00
parent d2a6330b7f
commit 0f6958f32e
3 changed files with 72 additions and 71 deletions

View File

@ -695,8 +695,9 @@
return $flags; return $flags;
} }
function getNotifyFlags ($_messageUID) { function getNotifyFlags ($_messageUID, $flags=null)
$flags = $this->icServer->getFlags($_messageUID, true); {
if ($flags===null) $flags = $this->icServer->getFlags($_messageUID, true);
if (PEAR::isError($flags)) { if (PEAR::isError($flags)) {
return null; return null;
} }

View File

@ -333,7 +333,7 @@
$this->t->set_var('charset',$GLOBALS['egw']->translation->charset()); $this->t->set_var('charset',$GLOBALS['egw']->translation->charset());
} }
// only notify when requested, notify flag (MDNSent/MDNnotSent) not set, and message not already seen (some servers do not support the MDNSent/MDNnotSent flag) // only notify when requested, notify flag (MDNSent/MDNnotSent) not set, and message not already seen (some servers do not support the MDNSent/MDNnotSent flag)
if ( $sent_not != "" && $this->bofelamimail->getNotifyFlags($this->uid) === null && strpos( array2string($flags),'Seen')===false) { if ( $sent_not != "" && $this->bofelamimail->getNotifyFlags($this->uid,($flags?$flags:null)) === null && strpos( array2string($flags),'Seen')===false) {
$this->t->set_var('sentNotify','sendNotify("'.$this->uid.'");'); $this->t->set_var('sentNotify','sendNotify("'.$this->uid.'");');
$this->t->set_var('lang_sendnotify',lang('The message sender has requested a response to indicate that you have read this message. Would you like to send a receipt?')); $this->t->set_var('lang_sendnotify',lang('The message sender has requested a response to indicate that you have read this message. Would you like to send a receipt?'));
} else { } else {

View File

@ -599,7 +599,7 @@ class uiwidgets
$this->bofelamimail->openConnection($_icServer); $this->bofelamimail->openConnection($_icServer);
$this->bofelamimail->reopen($_folderName); $this->bofelamimail->reopen($_folderName);
$flags = $this->bofelamimail->getFlags($headerData['uid']); $flags = $this->bofelamimail->getFlags($headerData['uid']);
if ($this->bofelamimail->getNotifyFlags($headerData['uid']) === null) if ($this->bofelamimail->getNotifyFlags($headerData['uid'],($flags?$flags:null)) === null)
{ {
$headers = $this->bofelamimail->getMessageHeader($headerData['uid']); $headers = $this->bofelamimail->getMessageHeader($headerData['uid']);
if ( isset($headers['DISPOSITION-NOTIFICATION-TO']) ) { if ( isset($headers['DISPOSITION-NOTIFICATION-TO']) ) {