Enable SlowSync optimization with old mappings; vCalendar 1.0 folding

This commit is contained in:
Jörg Lehrke 2010-02-08 19:50:37 +00:00
parent 0f512b0a6b
commit 30a17bc476
3 changed files with 11 additions and 5 deletions

View File

@ -285,10 +285,10 @@ class Horde_SyncML_Command_Alert extends Horde_SyncML_Command {
$synctype != ALERT_ONE_WAY_FROM_CLIENT && $synctype != ALERT_ONE_WAY_FROM_CLIENT &&
$synctype != ALERT_ONE_WAY_FROM_SERVER) { $synctype != ALERT_ONE_WAY_FROM_SERVER) {
$serverAnchorLast = 0; $serverAnchorLast = 0;
#if (!$anchormatch) { if (!$anchormatch) {
// Erase existing map: // Erase existing map:
$state->removeAllUID($this->_targetLocURI); $state->removeAllUID($this->_targetLocURI);
#} }
} }
// Now create the actual SyncML_Sync object, if it doesn't exist yet. // Now create the actual SyncML_Sync object, if it doesn't exist yet.
$sync = &$state->getSync($this->_targetLocURI); $sync = &$state->getSync($this->_targetLocURI);

View File

@ -237,14 +237,16 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync {
$guid = false; $guid = false;
$oguid = $state->getGlobalUID($type, $syncItem->getLocURI());
$guid = $registry->call($hordeType . '/search', $guid = $registry->call($hordeType . '/search',
array($state->convertClient2Server($syncItem->getContent(), $contentType), $contentType, $state->getGlobalUID($type, $syncItem->getLocURI()), $type)); array($state->convertClient2Server($syncItem->getContent(), $contentType), $contentType, $oguid, $type));
if ($guid) { if ($guid) {
// Check if the found entry came from the client // Check if the found entry came from the client
$guid_ts = $state->getSyncTSforAction($guid, 'add'); $guid_ts = $state->getSyncTSforAction($guid, 'add');
$sync_ts = $state->getChangeTS($type, $guid); $sync_ts = $state->getChangeTS($type, $guid);
if ($sync_ts && $sync_ts == $guid_ts) { if ($oguid != $guid && $sync_ts && $sync_ts == $guid_ts) {
// Entry came from the client, so we get a duplicate here // Entry came from the client, so we get a duplicate here
Horde::logMessage('SyncML: CONFLICT for locuri ' . $syncItem->getLocURI() Horde::logMessage('SyncML: CONFLICT for locuri ' . $syncItem->getLocURI()
. ' guid ' . $guid , __FILE__, __LINE__, PEAR_LOG_WARNING); . ' guid ' . $guid , __FILE__, __LINE__, PEAR_LOG_WARNING);

View File

@ -603,7 +603,11 @@ class Horde_iCalendar {
// last=20line // last=20line
while (preg_match_all('/^([^:]+;\s*((ENCODING=)?QUOTED-PRINTABLE|ENCODING=[Q|q])(.*=\r?\n)+(.*[^=])?\r?\n)/mU', $vCal, $matches)) { while (preg_match_all('/^([^:]+;\s*((ENCODING=)?QUOTED-PRINTABLE|ENCODING=[Q|q])(.*=\r?\n)+(.*[^=])?\r?\n)/mU', $vCal, $matches)) {
foreach ($matches[1] as $s) { foreach ($matches[1] as $s) {
$r = preg_replace('/=\r?\n[ \t]*/', '', $s); if ($this->isOldFormat()) {
$r = preg_replace('/=\r?\n([ \t])/', '\1', $s);
} else {
$r = preg_replace('/=\r?\n[ \t]*/', '', $s);
}
$vCal = str_replace($s, $r, $vCal); $vCal = str_replace($s, $r, $vCal);
} }
} }