Tracker: #2145 - message reading confirmation; Fix for MailServers, that do not support MDNSent/MDNnotSent flags

This commit is contained in:
Klaus Leithoff 2009-07-01 10:20:55 +00:00
parent c8236aa9f7
commit a7ed0a0255
3 changed files with 20 additions and 32 deletions

View File

@ -397,8 +397,15 @@
*/
function flagMessages($_flag, $_messageList)
{
if($this->_debug) error_log("ajaxfelamimail::flagMessages");
$this->bofelamimail->flagMessages($_flag, $_messageList);
if($this->_debug) error_log(__METHOD__."->".$_flag.':'.print_r($_messageList,true));
if (!empty($_messageList['msg']))
{
$this->bofelamimail->flagMessages($_flag, $_messageList['msg']);
}
else
{
if($this->_debug) error_log(__METHOD__."-> No messages selected.");
}
return $this->generateMessageList($this->sessionData['mailbox']);
}

View File

@ -209,6 +209,8 @@
$uiWidgets =& CreateObject('felamimail.uiwidgets');
// (regis) seems to be necessary to reopen...
$this->bofelamimail->reopen($this->mailbox);
// retrieve the flags of the message, before touching it.
if (!empty($this->uid)) $flags = $this->bofelamimail->getFlags($this->uid);
#print "$this->mailbox, $this->uid, $partID<br>";
$headers = $this->bofelamimail->getMessageHeader($this->uid, $partID);
if (PEAR::isError($headers)) {
@ -232,8 +234,8 @@
#_debug_array($bodyParts); exit;
#_debug_array($this->uid);
#_debug_array($this->bofelamimail->getFlags($this->uid)); #exit;
// flag the message as read/seen
if (!empty($this->uid)) $this->bofelamimail->flagMessages('read', $this->uid);
// flag the message as read/seen (if not already flagged)
if (!empty($this->uid) && strpos( array2string($flags),'Seen')===false) $this->bofelamimail->flagMessages('read', $this->uid);
$nextMessage = $this->bofelamimail->getNextMessage($this->mailbox, $this->uid);
@ -276,7 +278,8 @@
$this->t->set_file(array("displayMsg" => "view_message_printable.tpl"));
$this->t->set_var('charset',$GLOBALS['egw']->translation->charset());
}
if ( $sent_not != "" && $this->bofelamimail->getNotifyFlags($this->uid) === null ) {
// 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) {
$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?'));
} else {

View File

@ -220,37 +220,15 @@ function extendedSearch(_selectBox) {
function flagMessages(_flag)
{
var selectedMessages = new Array();
var selectedCheckBoxes = new Array();
resetMessageSelect();
var _messageList;
resetMessageSelect();
_messageList = xajax.getFormValues('formMessageList');
//alert(_messageList);
for(i=0; i< document.forms.formMessageList.elements.length; i++) {
if(document.forms.formMessageList.elements[i].checked) {
selectedMessages.push(document.forms.formMessageList.elements[i].value);
selectedCheckBoxes.push(document.forms.formMessageList.elements[i]);
}
}
// alert(_flag);
// switch(_flag) {
// case 'read':
// for(i=0; i< selectedMessages.length; i++) {
// document.getElementById('row_' + selectedMessages[i]).style.fontWeight='normal';
// selectedCheckBoxes[i].checked = false;
// }
// break;
// case 'unread':
// for(i=0; i< selectedMessages.length; i++) {
// document.getElementById('row_' + selectedMessages[i]).style.fontWeight='bold';
// selectedCheckBoxes[i].checked = false;
// }
// break;
// }
setStatusMessage('<span style="font-weight: bold;">' + lang_updating_message_status + '</span>');
document.getElementById('divMessageList').innerHTML = '';
xajax_doXMLHTTP("felamimail.ajaxfelamimail.flagMessages", _flag, selectedMessages);
xajax_doXMLHTTP("felamimail.ajaxfelamimail.flagMessages", _flag, _messageList);
fm_startTimerMessageListUpdate(refreshTimeOut);
}