- id calendar;
-
- if (self->storedEventObject != nil)
- return [self->storedEventObject isNotNull] ? self->storedEventObject : nil;
-
- calendar = [self calendarFolder];
- if ([calendar isKindOfClass:[NSException class]]) {
- [self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
- }
- else {
- NSString *filename;
-
- filename = [calendar resourceNameForEventUID:[[self inEvent] uid]];
- if (filename != nil) {
- // TODO: When we get an exception, this might be an auth issue meaning
- // that the UID indeed exists but that the user has no access to
- // the object.
- // Of course this is quite unusual for the private calendar though.
- id tmp;
-
- tmp = [calendar lookupName:filename inContext:[self context] acquire:NO];
- if ([tmp isNotNull] && ![tmp isKindOfClass:[NSException class]])
- self->storedEventObject = [tmp retain];
+ SOGoAppointmentFolder *calendar;
+ NSString *filename;
+
+ if (!storedEventObject)
+ {
+ calendar = [self calendarFolder];
+ if ([calendar isKindOfClass: [NSException class]])
+ [self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
+ else
+ {
+ filename = [calendar resourceNameForEventUID:[[self inEvent] uid]];
+ if (filename)
+ {
+ storedEventObject = [calendar lookupName: filename
+ inContext: [self context]
+ acquire: NO];
+ if ([storedEventObject isKindOfClass: [NSException class]])
+ storedEventObject = nil;
+ else
+ [storedEventObject retain];
+ }
+ }