/** * Report the status of this folder. * * @param Horde_Kolab_Storage_Folder_Stamp $previous The previous stamp, * if available. * * @return Horde_Kolab_Storage_Folder_Stamp The stamp that can be used for * detecting folder changes. */ public function getStamp(Horde_Kolab_Storage_Folder_Stamp $previous = null) { if (empty($previous) || $previous->getToken() === false) { $this->_logger->debug('[KOLAB_STORAGE] Fetching stamp without token.'); return $this->_driver->getStamp($this->_folder->getPath()); } try { $this->_logger->debug('[KOLAB_STORAGE] Fetching stamp WITH token.'); return $this->_driver->getStampFromToken($this->_folder->getPath(), $previous->getToken(), $previous->ids()); } catch (Horde_Kolab_Storage_Exception $e) { // Possibly not supported with the current IMAP driver. $this->_logger->debug('[KOLAB_STORAGE] Attempted to fetch stamp with token, but backend did not support.'); return $this->_driver->getStamp($this->_folder->getPath()); } }
/** * Returns a stamp for the current folder status. This stamp can be used to * identify changes in the folder data. This method, as opposed to * self::getStamp(), uses the IMAP client's token to calculate the changes. * * @param string $folder Return the stamp for this folder. * @param string $token A sync token provided by the IMAP server. * @param array $ids An array of UIDs that we know about. * * @return Horde_Kolab_Storage_Folder_Stamp A stamp indicating the current * folder status. */ public function getStampFromToken($folder, $token, array $ids) { return $this->_driver->getStampFromToken($folder, $token, $ids); }