140 } |
140 } |
141 if (iEntryType == MCalChangeCallBack2::EChangeEntryEvent && aChange.iEntryType == CCalEntry::ETodo) |
141 if (iEntryType == MCalChangeCallBack2::EChangeEntryEvent && aChange.iEntryType == CCalEntry::ETodo) |
142 { |
142 { |
143 return EFalse; |
143 return EFalse; |
144 } |
144 } |
145 |
145 |
146 // Check for the requested entry type and the change type. |
|
147 // Don't notify clients which are listening for event and |
|
148 // to-do notifictaions when note event is modified. |
|
149 if ( ((iEntryType == MCalChangeCallBack2::EChangeEntryEvent) || |
|
150 (iEntryType == MCalChangeCallBack2::EChangeEntryTodo)) && |
|
151 (aChange.iEntryType == CCalEntry::ENote)) |
|
152 { |
|
153 return EFalse; |
|
154 } |
|
155 |
|
156 // Notify clients which are listening for event type note modifications. |
|
157 if (iEntryType == MCalChangeCallBack2::EChangeEntryNote && |
|
158 aChange.iEntryType == CCalEntry::ENote) |
|
159 { |
|
160 return ETrue; |
|
161 } |
|
162 |
|
163 // Check the entry is within the time range specified by the filter |
146 // Check the entry is within the time range specified by the filter |
164 // aChange.iRepeatRule gives the repeat data for the newly stored entry. If this operation is an update, |
147 // aChange.iRepeatRule gives the repeat data for the newly stored entry. If this operation is an update, |
165 // then aChange.iOriginalRepeatRule gives the repeat data for the old entry. |
148 // then aChange.iOriginalRepeatRule gives the repeat data for the old entry. |
166 TBool entryInTimeRange = CheckChangeWithinRangeL(aChange.iRepeatRule, aChange.iStartTimeOfEntryUtc, aChange.iEndTimeOfEntryUtc); |
149 TBool entryInTimeRange = CheckChangeWithinRangeL(aChange.iRepeatRule, aChange.iStartTimeOfEntryUtc, aChange.iEndTimeOfEntryUtc); |
167 TBool originalEntryInTimeRange = CheckChangeWithinRangeL(aChange.iOriginalRepeatRule, aChange.iOriginalStartTimeUtc, aChange.iOriginalEndTimeUtc); |
150 TBool originalEntryInTimeRange = CheckChangeWithinRangeL(aChange.iOriginalRepeatRule, aChange.iOriginalStartTimeUtc, aChange.iOriginalEndTimeUtc); |
296 * Check to see if an operation can be performed due to backup\restore process |
279 * Check to see if an operation can be performed due to backup\restore process |
297 * @return ETrue, if the operation can not be performed, EFalse otherwise. |
280 * @return ETrue, if the operation can not be performed, EFalse otherwise. |
298 */ |
281 */ |
299 TBool CAgnServerSession::CheckBackupRestore() |
282 TBool CAgnServerSession::CheckBackupRestore() |
300 { |
283 { |
301 if(iBackupRestoreLock |
284 if((iBackupRestoreLock || iAgnServer.BackupRestoreInProgress()) |
302 //All opeerations apart from the following ones are not allowed when Backup\Restore is in progress. |
285 //All opeerations apart from the following ones are not allowed when Backup\Restore is in progress. |
303 && iMessage.Function() != ECloseAgenda |
286 && iMessage.Function() != ECloseAgenda |
304 && iMessage.Function() != ECancelChangeNotification |
287 && iMessage.Function() != ECancelChangeNotification |
305 && iMessage.Function() != EDisableChangeBroadcast |
288 && iMessage.Function() != EDisableChangeBroadcast |
306 && iMessage.Function() != ETransmitBuffer |
289 && iMessage.Function() != ETransmitBuffer |
2080 TPckgBuf<TTime> end; |
2063 TPckgBuf<TTime> end; |
2081 iMessage.ReadL(KSlot1, end); |
2064 iMessage.ReadL(KSlot1, end); |
2082 |
2065 |
2083 // Restore length |
2066 // Restore length |
2084 const TInt KBufferSize = iMessage.GetDesLength(KSlot2); |
2067 const TInt KBufferSize = iMessage.GetDesLength(KSlot2); |
|
2068 |
|
2069 if (KBufferSize == KErrArgument) |
|
2070 { |
|
2071 PanicClientL(EIndexError); |
|
2072 } |
|
2073 else if (KBufferSize == KErrBadDescriptor) |
|
2074 { |
|
2075 PanicClientL(EBadDescriptor); |
|
2076 } |
|
2077 User::LeaveIfError(KBufferSize); |
2085 |
2078 |
2086 // Restore buffer |
2079 // Restore buffer |
2087 CBufFlat* buffer = CBufFlat::NewL(KBufferSize); |
2080 CBufFlat* buffer = CBufFlat::NewL(KBufferSize); |
2088 CleanupStack::PushL(buffer); |
2081 CleanupStack::PushL(buffer); |
2089 buffer->ExpandL(0, KBufferSize); |
2082 buffer->ExpandL(0, KBufferSize); |
4061 } |
4054 } |
4062 else |
4055 else |
4063 { |
4056 { |
4064 // Clear all the notifications in the buffer |
4057 // Clear all the notifications in the buffer |
4065 iFileBufferedNotification->Reset(); |
4058 iFileBufferedNotification->Reset(); |
4066 iFileBufferedNotificationStream.Open(*iBufferedNotification); |
4059 iFileBufferedNotificationStream.Open(*iFileBufferedNotification); |
4067 |
4060 |
4068 // Add a single 'Undefined Change' notification to the notification buffer |
4061 // Add a single 'Undefined Change' notification to the notification buffer |
4069 CAgnFileChangeInfo* fileChang = CAgnFileChangeInfo::NewL(NULL, MCalFileChangeObserver::ECalendarInfoUpdated); |
4062 CAgnFileChangeInfo* fileChang = CAgnFileChangeInfo::NewL(NULL, MCalFileChangeObserver::ECalendarInfoUpdated); |
4070 CleanupStack::PushL(fileChang); |
4063 CleanupStack::PushL(fileChang); |
4071 aFileChangeInfo.ExternalizeL(iFileBufferedNotificationStream); |
4064 aFileChangeInfo.ExternalizeL(iFileBufferedNotificationStream); |