mirror of
https://github.com/YunoHost-Apps/z-push_ynh.git
synced 2024-09-03 18:05:58 +02:00
Update to latest sources
This commit is contained in:
parent
53e7117d18
commit
92ac226c09
1 changed files with 26 additions and 25 deletions
|
@ -389,14 +389,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
}
|
}
|
||||||
if (strlen($plainBody) > 0) {
|
if (strlen($plainBody) > 0) {
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->addTextParts(): The message has PLAIN body"));
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->addTextParts(): The message has PLAIN body"));
|
||||||
if (strlen($htmlSource) > 0) {
|
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->addTextParts(): The original message had HTML body, we cast new PLAIN to HTML"));
|
|
||||||
$altEmail->addSubPart('<html><body><p>' . str_replace("\n", "<br/>", str_replace("\r\n", "\n", $plainBody)) . "</p>" . $separatorHtml . $htmlSource . $separatorHtmlEnd, array('content_type' => 'text/html; charset=utf-8', 'encoding' => 'base64'));
|
|
||||||
}
|
|
||||||
if (strlen($plainSource) > 0) {
|
if (strlen($plainSource) > 0) {
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->addTextParts(): The original message had PLAIN body"));
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->addTextParts(): The original message had PLAIN body"));
|
||||||
$altEmail->addSubPart($plainBody . $separator . str_replace("\n", "\n> ", "> " . $plainSource), array('content_type' => 'text/plain; charset=utf-8', 'encoding' => 'base64'));
|
$altEmail->addSubPart($plainBody . $separator . str_replace("\n", "\n> ", "> " . $plainSource), array('content_type' => 'text/plain; charset=utf-8', 'encoding' => 'base64'));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->addTextParts(): The original message had not PLAIN body, we use original HTML body to create PLAIN"));
|
||||||
|
$altEmail->addSubPart($plainBody . $separator . str_replace("\n", "\n> ", "> " . Utils::ConvertHtmlToText($htmlSource)), array('content_type' => 'text/plain; charset=utf-8', 'encoding' => 'base64'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$boundary = '=_' . md5(rand() . microtime());
|
$boundary = '=_' . md5(rand() . microtime());
|
||||||
|
@ -2073,8 +2073,12 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
protected function getFolderIdFromImapId($imapid, $case_sensitive = true) {
|
protected function getFolderIdFromImapId($imapid, $case_sensitive = true) {
|
||||||
$this->InitializePermanentStorage();
|
$this->InitializePermanentStorage();
|
||||||
|
|
||||||
|
if (!isset($this->permanentStorage->fmFimapFid)) {
|
||||||
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') IMAP cache folder not found, creating one", $imapid));
|
||||||
|
$this->GetFolderList();
|
||||||
|
}
|
||||||
|
|
||||||
if ($case_sensitive) {
|
if ($case_sensitive) {
|
||||||
if (isset($this->permanentStorage->fmFimapFid)) {
|
|
||||||
if (isset($this->permanentStorage->fmFimapFid[$imapid])) {
|
if (isset($this->permanentStorage->fmFimapFid[$imapid])) {
|
||||||
$folderid = $this->permanentStorage->fmFimapFid[$imapid];
|
$folderid = $this->permanentStorage->fmFimapFid[$imapid];
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, $folderid));
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, $folderid));
|
||||||
|
@ -2085,9 +2089,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
if (isset($this->permanentStorage->fmFimapFidLowercase)) {
|
|
||||||
if (isset($this->permanentStorage->fmFimapFidLowercase[strtolower($imapid)])) {
|
if (isset($this->permanentStorage->fmFimapFidLowercase[strtolower($imapid)])) {
|
||||||
$folderid = $this->permanentStorage->fmFimapFidLowercase[strtolower($imapid)];
|
$folderid = $this->permanentStorage->fmFimapFidLowercase[strtolower($imapid)];
|
||||||
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s', false) = %s", $imapid, $folderid));
|
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->getFolderIdFromImapId('%s', false) = %s", $imapid, $folderid));
|
||||||
|
@ -2098,7 +2100,6 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, 'not initialized!'));
|
ZLog::Write(LOGLEVEL_WARN, sprintf("BackendIMAP->getFolderIdFromImapId('%s') = %s", $imapid, 'not initialized!'));
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue