mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 08:23:28 +00:00
Monotone-Parent: c8a00b4000a967d747332ed76e3501e958d17cfb
Monotone-Revision: 54dc6ee0dac49ddab76097b4e22cd6d4d5d91a3d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-03-07T21:33:13 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
@interface SOGoCalendarComponent : SOGoContentObject
|
||||
{
|
||||
iCalCalendar *calendar;
|
||||
NSString *calContent;
|
||||
}
|
||||
|
||||
- (NSString *) componentTag;
|
||||
|
||||
@@ -68,6 +68,7 @@ static BOOL sendEMailNotifications = NO;
|
||||
if ((self = [super init]))
|
||||
{
|
||||
calendar = nil;
|
||||
calContent = nil;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -77,6 +78,8 @@ static BOOL sendEMailNotifications = NO;
|
||||
{
|
||||
if (calendar)
|
||||
[calendar release];
|
||||
if (calContent)
|
||||
[calContent release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -92,6 +95,69 @@ static BOOL sendEMailNotifications = NO;
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) _filterPrivateComponent: (iCalEntityObject *) component
|
||||
{
|
||||
[component setSummary: @""];
|
||||
[component setComment: @""];
|
||||
[component setUserComment: @""];
|
||||
[component setLocation: @""];
|
||||
[component setCategories: @""];
|
||||
[component setUrl: @""];
|
||||
[component removeAllAttendees];
|
||||
[component removeAllAlarms];
|
||||
}
|
||||
|
||||
- (NSString *) contentAsString
|
||||
{
|
||||
NSString *tmpContent, *email;
|
||||
iCalCalendar *tmpCalendar;
|
||||
iCalRepeatableEntityObject *tmpComponent;
|
||||
WOContext *context;
|
||||
|
||||
if (!calContent)
|
||||
{
|
||||
tmpContent = [super contentAsString];
|
||||
calContent = tmpContent;
|
||||
if ([tmpContent length] > 0)
|
||||
{
|
||||
tmpCalendar = [iCalCalendar parseSingleFromSource: tmpContent];
|
||||
tmpComponent = (iCalRepeatableEntityObject *) [tmpCalendar firstChildWithTag: [self componentTag]];
|
||||
if (![tmpComponent isPublic])
|
||||
{
|
||||
context = [[WOApplication application] context];
|
||||
email = [[context activeUser] email];
|
||||
if (!([tmpComponent isOrganizer: email]
|
||||
|| [tmpComponent isParticipant: email]))
|
||||
{
|
||||
// content = tmpContent;
|
||||
[self _filterPrivateComponent: tmpComponent];
|
||||
calContent = [tmpCalendar versitString];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[calContent retain];
|
||||
}
|
||||
|
||||
return calContent;
|
||||
}
|
||||
|
||||
- (NSException *) saveContentString: (NSString *) contentString
|
||||
baseVersion: (unsigned int) baseVersion
|
||||
{
|
||||
NSException *result;
|
||||
|
||||
result = [super saveContentString: contentString
|
||||
baseVersion: baseVersion];
|
||||
if (!result && calContent)
|
||||
{
|
||||
[calContent release];
|
||||
calContent = nil;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (iCalCalendar *) calendar
|
||||
{
|
||||
NSString *iCalString;
|
||||
|
||||
Reference in New Issue
Block a user