/** * Checks if a message is in the synchronization interval (window) * if a filter (e.g. Sync items two weeks back) or limits this synchronization. * These checks only apply to Emails and Appointments only, Contacts, Tasks and Notes do not have time restrictions. * * @param string $messageid the message id to be checked * * @access private * @return boolean */ private function isMessageInSyncInterval($messageid) { // if there is no restriciton we do not need to check if ($this->cutoffdate === false) { return true; } ZLog::Write(LOGLEVEL_DEBUG, sprintf("ImportChangesICS->isMessageInSyncInterval('%s'): cut off date is: %s", $messageid, $this->cutoffdate)); $entryid = mapi_msgstore_entryidfromsourcekey($this->store, $this->folderid, hex2bin($messageid)); if (!$entryid) { ZLog::Write(LOGLEVEL_WARN, sprintf("ImportChangesICS->isMessageInSyncInterval('%s'): Error, unable to resolve message id: 0x%X", $messageid, mapi_last_hresult())); return false; } $mapimessage = mapi_msgstore_openentry($this->store, $entryid); if (!$mapimessage) { ZLog::Write(LOGLEVEL_WARN, sprintf("ImportChangesICS->isMessageInSyncInterval('%s'): Error, unable to open entry id: 0x%X", $messageid, mapi_last_hresult())); return false; } if ($this->contentClass == "Email") { return MAPIUtils::IsInEmailSyncInterval($this->store, $mapimessage, $this->cutoffdate); } elseif ($this->contentClass == "Calendar") { return MAPIUtils::IsInCalendarSyncInterval($this->store, $mapimessage, $this->cutoffdate); } return true; }