1
0
Fork 0
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:
polytan02 2015-09-27 19:10:18 +02:00
parent 81eed51c77
commit ce0dd6bd1b
4 changed files with 16 additions and 4 deletions

View file

@ -227,7 +227,7 @@ class BackendCalDAV extends BackendDiff {
/* Calculating the range of events we want to sync */ /* Calculating the range of events we want to sync */
$begin = gmdate("Ymd\THis\Z", $cutoffdate); $begin = gmdate("Ymd\THis\Z", $cutoffdate);
$finish = gmdate("Ymd\THis\Z", 2147483647); $finish = gmdate("Ymd\THis\Z", CALDAV_MAX_SYNC_PERIOD);
$path = $this->_caldav_path . substr($folderid, 1) . "/"; $path = $this->_caldav_path . substr($folderid, 1) . "/";
if ($folderid[0] == "C") { if ($folderid[0] == "C") {

View file

@ -64,4 +64,9 @@ define('CALDAV_PERSONAL', 'PRINCIPAL');
// DAViCal, SOGo and SabreDav support it // DAViCal, SOGo and SabreDav support it
// SabreDav version must be at least 1.9.0, otherwise set this to false // SabreDav version must be at least 1.9.0, otherwise set this to false
// Setting this to false will work with most servers, but it will be slower // Setting this to false will work with most servers, but it will be slower
define('CALDAV_SUPPORTS_SYNC', false); define('CALDAV_SUPPORTS_SYNC', false);
// Maximum period to sync.
// Some servers don't support more than 10 years so you will need to change this
define('CALDAV_MAX_SYNC_PERIOD', 2147483647);

View file

@ -1144,7 +1144,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
$bpo = $contentparameters->BodyPreference($output->asbody->type); $bpo = $contentparameters->BodyPreference($output->asbody->type);
if (Request::GetProtocolVersion() >= 14.0 && $bpo->GetPreview()) { if (Request::GetProtocolVersion() >= 14.0 && $bpo->GetPreview()) {
$output->asbody->preview = Utils::Utf8_truncate(Utils::ConvertHtmlToText($textBody), $bpo->GetPreview()); // Preview must be always plaintext
$previewText = "";
Mail_mimeDecode::getBodyRecursive($message, "plain", $previewText, true);
if (strlen($previewText) == 0) {
Mail_mimeDecode::getBodyRecursive($message, "html", $previewText, true);
$previewText = Utils::ConvertHtmlToText($previewText);
}
$output->asbody->preview = Utils::Utf8_truncate($previewText, $bpo->GetPreview());
} }
} }
/* END fmbiete's contribution r1528, ZP-320 */ /* END fmbiete's contribution r1528, ZP-320 */

View file

@ -34,7 +34,7 @@ $val = $caldav->GetCalendarDetails($path);
print_r($val); print_r($val);
$begin = gmdate("Ymd\THis\Z", time() - 24*7*60*60); $begin = gmdate("Ymd\THis\Z", time() - 24*7*60*60);
$finish = gmdate("Ymd\THis\Z", 2147483647); $finish = gmdate("Ymd\THis\Z", CALDAV_MAX_SYNC_PERIOD);
$msgs = $caldav->GetEvents($begin, $finish, $path); $msgs = $caldav->GetEvents($begin, $finish, $path);
print_r($msgs); print_r($msgs);