Monotone-Parent: ad0652e110056f0a30b9fa6a1efffe2bd0de832a

Monotone-Revision: 9995223a0452fd05c8a2bc29a4e75bddaa07438b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-06-17T13:35:08
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2009-06-17 13:35:08 +00:00
parent 0e0a8468e6
commit b37c58e765
3 changed files with 27 additions and 21 deletions

View File

@ -1,5 +1,9 @@
2009-06-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailPartViewers/UIxMailPartICalViewer.m (-storedEventObject):
use the new "storedEventFetched" bool ivar to specify whether we
already attempted to fetch the event from the user calendars.
* SoObjects/SOGo/SOGoUser.m (-rolesForObject:inContext:): do not
query the acls for the object if the current user is its owner.

View File

@ -38,6 +38,7 @@
SOGoDateFormatter *dateFormatter;
id item;
SOGoAppointmentObject *storedEventObject;
BOOL storedEventFetched;
iCalEvent *storedEvent;
}

View File

@ -255,29 +255,30 @@
/* lookup object in the users Calendar */
SOGoAppointmentFolder *calendar;
NSString *filename;
if ([self hasCalendarAccess])
if (!storedEventFetched)
{
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]])
if ([self hasCalendarAccess])
{
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];
}
}
}
else
[storedEventObject retain];
}
}
}
storedEventFetched = YES;
}
return storedEventObject;