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

This commit is contained in:
Klaus Leithoff 2009-06-30 10:11:48 +00:00
parent 7cd2fba856
commit 0bfa82e6dc
4 changed files with 21 additions and 33 deletions

View File

@ -395,8 +395,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

@ -647,7 +647,7 @@
function flagMessages($_flag, $_messageUID)
{
#error_log("felamimail::bocompose::flagMessages");
//error_log(__METHOD__."->".print_r($_messageUID,true).":".$_flag);
if(!is_array($_messageUID)) {
#return false;
$_messageUID=array($_messageUID);

View File

@ -248,6 +248,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);
#_debug_array($headers);exit;
@ -262,9 +264,9 @@
// Problem is: the iFrame Layout provides the scrollbars.
#$bodyParts = $this->bofelamimail->getMessageBody($this->uid,'',$partID);
#_debug_array($bodyParts); exit;
#_debug_array($this->bofelamimail->getFlags($this->uid)); exit;
// flag the message as read/seen
if (!empty($this->uid)) $this->bofelamimail->flagMessages('read', $this->uid);
#_debug_array($flags); exit;
// 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);
@ -307,7 +309,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

@ -166,37 +166,15 @@ function extendedSearch(_selectBox) {
function flagMessages(_flag)
{
var selectedMessages = new Array();
var selectedCheckBoxes = new Array();
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);
}