on deleting auto-draft-messages, use remove_immediately, to avoid cluttering the trash-box

This commit is contained in:
Klaus Leithoff 2012-05-02 14:21:43 +00:00
parent 154b8ac761
commit 0b3e5228ac
3 changed files with 16 additions and 16 deletions

View File

@ -335,7 +335,7 @@ class ajaxfelamimail
if (isset($bocompose->sessionData['lastDrafted'])) $lastDrafted = $bocompose->sessionData['lastDrafted'];
$messageUid = $bocompose->saveAsDraft($formData,$folder); // folder may change
if ($lastDrafted && is_array($lastDrafted) && isset($lastDrafted['uid']) && !empty($lastDrafted['uid'])) $lastDrafted['uid'] = trim($lastDrafted['uid']);
if ($lastDrafted && is_array($lastDrafted) && isset($lastDrafted['uid']) && !empty($lastDrafted['uid'])) $this->bofelamimail->deleteMessages((array)$lastDrafted['uid'],$lastDrafted['folder']);
if ($lastDrafted && is_array($lastDrafted) && isset($lastDrafted['uid']) && !empty($lastDrafted['uid'])) $this->bofelamimail->deleteMessages((array)$lastDrafted['uid'],$lastDrafted['folder'],"remove_immediately");
if ($_autoSave)
{
$bocompose->sessionData['lastDrafted'] = array('uid'=>$messageUid,'folder'=>$folder);

View File

@ -1171,7 +1171,7 @@
if (isset($lastDrafted['uid']) && (empty($lastDrafted['uid']) || $lastDrafted['uid'] == $this->sessionData['uid'])) $lastDrafted=false;
//error_log(__METHOD__.__LINE__.array2string($lastDrafted));
}
if ($lastDrafted && is_array($lastDrafted) && $bofelamimail->isDraftFolder($lastDrafted['folder'])) $bofelamimail->deleteMessages((array)$lastDrafted['uid'],$lastDrafted['folder']);
if ($lastDrafted && is_array($lastDrafted) && $bofelamimail->isDraftFolder($lastDrafted['folder'])) $bofelamimail->deleteMessages((array)$lastDrafted['uid'],$lastDrafted['folder'],"remove_immediately");
unset($this->sessionData['lastDrafted']);
//error_log("handling draft messages, flagging and such");

View File

@ -824,7 +824,7 @@ class felamimail_bo
return true;
}
function deleteMessages($_messageUID, $_folder=NULL)
function deleteMessages($_messageUID, $_folder=NULL, $_forceDeleteMethod='no')
{
//error_log(__METHOD__.__LINE__.'->'.array2string($_messageUID).','.$_folder);
$msglist = '';
@ -842,8 +842,8 @@ class felamimail_bo
return false;
}
}
$deleteOptions = $this->mailPreferences->preferences['deleteOptions'];
$deleteOptions = $_forceDeleteMethod; // use forceDeleteMethod if not "no", or unknown method
if ($_forceDeleteMethod === 'no' || !in_array($_forceDeleteMethod,array('move_to_trash',"mark_as_deleted","remove_immediately"))) $deleteOptions = $this->mailPreferences->preferences['deleteOptions'];
$trashFolder = $this->mailPreferences->preferences['trashFolder'];
$draftFolder = $this->mailPreferences->preferences['draftFolder']; //$GLOBALS['egw_info']['user']['preferences']['felamimail']['draftFolder'];
$templateFolder = $this->mailPreferences->preferences['templateFolder']; //$GLOBALS['egw_info']['user']['preferences']['felamimail']['templateFolder'];
@ -989,14 +989,14 @@ class felamimail_bo
function getNotifyFlags ($_messageUID, $flags=null)
{
if($flags===null) $flags = $this->icServer->getFlags($_messageUID, true);
if (self::$debug) error_log(__METHOD__.$_messageUID.array2string($flags));
if (self::$debug) error_log(__METHOD__.$_messageUID.' Flags:'.array2string($flags));
if (PEAR::isError($flags)) {
return null;
}
if ( in_array('MDNSent',$flags[0]) )
if ( stripos( array2string($flags),'MDNSent')!==false)
return true;
if ( in_array('MDNnotSent',$flags[0]) )
if ( stripos( array2string($flags),'MDNnotSent')!==false)
return false;
return null;