mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 21:53:19 +00:00
Monotone-Parent: 649a1187cf216e088818ea020c5b497e84dd0fa4
Monotone-Revision: 2ce562acf878ad1f7c91a19309985a2f48a7cd2d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-28T17:22:36 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -215,29 +215,37 @@
|
||||
return [folder lookupName: @"personal" inContext: context acquire: NO];
|
||||
}
|
||||
|
||||
- (BOOL) hasCalendarAccess
|
||||
{
|
||||
return [[context activeUser] canAccessModule: @"Calendar"];
|
||||
}
|
||||
|
||||
- (SOGoAppointmentObject *) storedEventObject
|
||||
{
|
||||
/* lookup object in the users Calendar */
|
||||
SOGoAppointmentFolder *calendar;
|
||||
NSString *filename;
|
||||
|
||||
if (!storedEventObject)
|
||||
if ([self hasCalendarAccess])
|
||||
{
|
||||
calendar = [self calendarFolder];
|
||||
if ([calendar isKindOfClass: [NSException class]])
|
||||
[self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
|
||||
else
|
||||
if (!storedEventObject)
|
||||
{
|
||||
filename = [calendar resourceNameForEventUID:[[self inEvent] uid]];
|
||||
if (filename)
|
||||
calendar = [self calendarFolder];
|
||||
if ([calendar isKindOfClass: [NSException class]])
|
||||
[self errorWithFormat:@"Did not find Calendar folder: %@", calendar];
|
||||
else
|
||||
{
|
||||
storedEventObject = [calendar lookupName: filename
|
||||
inContext: [self context]
|
||||
acquire: NO];
|
||||
if ([storedEventObject isKindOfClass: [NSException class]])
|
||||
storedEventObject = nil;
|
||||
else
|
||||
[storedEventObject retain];
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -418,7 +426,8 @@
|
||||
|
||||
- (BOOL) canOriginalEventBeUpdated
|
||||
{
|
||||
return ([self hasSenderStatusChanged]
|
||||
return ([self hasCalendarAccess]
|
||||
&& [self hasSenderStatusChanged]
|
||||
&& ([[inEvent sequence] compare: [storedEvent sequence]]
|
||||
!= NSOrderedAscending));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user