Commit 123a789b authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #498 in ZP/z-push from...

Merge pull request #498 in ZP/z-push from bugfix/ZP-1169-kopano-mapi_e_unconfigured-0x8004011c to develop

* commit '124d3ae1':
  ZP-1169 KopanoChangesWrapper->hasDiscardDataFlag() is lowercase as it's a private method.
  ZP-1169 Reinitialize ICS exporter if it was used in Ping before on re-usage.
parents 6e2f98e6 124d3ae1
...@@ -231,6 +231,18 @@ class ExportChangesICS implements IExportChanges{ ...@@ -231,6 +231,18 @@ class ExportChangesICS implements IExportChanges{
return $ret; return $ret;
} }
/**
* Indicates if the exporter was configured with the BACKEND_DISCARD_DATA flag.
*
* @access public
* @return boolean
*/
public function HasDiscardDataFlag() {
if (isset($this->flags) && $this->flags & BACKEND_DISCARD_DATA) {
return true;
}
return false;
}
/** /**
* Reads the current state from the Exporter * Reads the current state from the Exporter
......
...@@ -74,6 +74,12 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -74,6 +74,12 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
* @return KopanoChangesWrapper | boolean * @return KopanoChangesWrapper | boolean
*/ */
static public function GetWrapper($storeName, $session, $store, $folderid, $ownFolder) { static public function GetWrapper($storeName, $session, $store, $folderid, $ownFolder) {
// if existing exporter is used by Ping we need to discard it so it's fully reconfigured (ZP-1169)
if (isset(self::$wrappers[$storeName][$folderid]) && self::$wrappers[$storeName][$folderid]->hasDiscardDataFlag()) {
ZLog::Write(LOGLEVEL_DEBUG, "KopanoChangesWrapper::GetWrapper(): Found existing notification check exporter. Reinitializing.");
unset(self::$wrappers[$storeName][$folderid]);
}
// check early due to the folderstats // check early due to the folderstats
if (isset(self::$wrappers[$storeName][$folderid])) { if (isset(self::$wrappers[$storeName][$folderid])) {
return self::$wrappers[$storeName][$folderid]; return self::$wrappers[$storeName][$folderid];
...@@ -151,6 +157,21 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges { ...@@ -151,6 +157,21 @@ class KopanoChangesWrapper implements IImportChanges, IExportChanges {
return $this->current == $this->replyback; return $this->current == $this->replyback;
} }
/**
* Indicates if the current IChanges object is an ICS exporter and has the BACKEND_DISCARD_DATA flag configured.
* These are used to verify notifications e.g. in Ping.
*
* @access private
* @return boolean
*/
private function hasDiscardDataFlag() {
if (isset($this->current) && $this->current instanceof ExportChangesICS && $this->current->HasDiscardDataFlag()) {
return true;
}
return false;
}
/** /**
* Initializes the correct importer, exporter or ReplyBackImExporter. * Initializes the correct importer, exporter or ReplyBackImExporter.
* The wrapper needs to be prepared as importer or exporter before. * The wrapper needs to be prepared as importer or exporter before.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment