Skip to content

Commit

Permalink
Merge pull request Z-Hub#94 from matidau/as16-imap-drafts-export
Browse files Browse the repository at this point in the history
AS16 Imap Drafts Export
  • Loading branch information
matidau authored Jul 29, 2024
2 parents b6580cc + 1d4b418 commit 7a4702d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/backend/imap/imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,16 @@ public function GetMessageList($folderid, $cutoffdate) {
$message["star"] = 0;
}

// 'draft'
$isdraftfolder = ($this->GetFolder($this->getFolderIdFromImapId($folderid))->type === SYNC_FOLDER_TYPE_DRAFTS);

if ((isset($overview->draft) && $overview->draft) || $isdraftfolder) {
$message["draft"] = 1;
}
else {
$message["draft"] = 0;
}

$messages[] = $message;
}
}
Expand Down Expand Up @@ -1362,6 +1372,14 @@ public function GetMessage($folderid, $id, $contentparameters) {
$output->lastverbexecuted = SYNC_MAIL_LASTVERB_UNKNOWN;
}
}

if (Request::GetProtocolVersion() >= 16.0) {

//set so message is fully exported
if (isset($stat["draft"]) && $stat["draft"]) {
$output->isdraft = true;
}
}
}

$Mail_RFC822 = new Mail_RFC822();
Expand Down Expand Up @@ -1622,6 +1640,16 @@ public function StatMessage($folderid, $id) {
$entry["star"] = 0;
}

// 'draft'
$isdraftfolder = ($this->GetFolder($folderid)->type === SYNC_FOLDER_TYPE_DRAFTS);

if ((isset($overview->draft) && $overview->draft) || $isdraftfolder) {
$entry["draft"] = 1;
}
else {
$entry["draft"] = 0;
}

return $entry;
}

Expand Down

0 comments on commit 7a4702d

Please sign in to comment.