From cdedcdfa104ce8962c8c25feb5d6f03e087d0459 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 16 Jan 2008 18:59:58 +0000 Subject: [PATCH] Monotone-Parent: cbba640dfc6321c0f4565ae72d616bc60cb20407 Monotone-Revision: 1f959c8c87357cf8d3745bf7b492bc7800597701 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-01-16T18:59:58 Monotone-Branch: ca.inverse.sogo --- Scripts/sogo-user.pl | 0 .../Appointments/SOGoCalendarComponent.m | 4 +- SoObjects/Contacts/SOGoContactGCSEntry.m | 3 ++ SoObjects/Mailer/SOGoMailAccounts.m | 2 +- SoObjects/Mailer/SOGoMailObject.m | 2 +- SoObjects/SOGo/SOGoContentObject.h | 2 +- SoObjects/SOGo/SOGoContentObject.m | 41 ++++++++++--------- 7 files changed, 29 insertions(+), 25 deletions(-) delete mode 100755 Scripts/sogo-user.pl diff --git a/Scripts/sogo-user.pl b/Scripts/sogo-user.pl deleted file mode 100755 index e69de29bb..000000000 diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index c8ed4eb3a..33dd2b6e6 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -126,7 +126,7 @@ static BOOL sendEMailNotifications = NO; sm = [SoSecurityManager sharedSecurityManager]; if (![sm validatePermission: SOGoCalendarPerm_ViewAllComponent onObject: self inContext: context]) - iCalString = content; + iCalString = [record objectForKey: @"c_content"]; else if (![sm validatePermission: SOGoCalendarPerm_ViewDAndT onObject: self inContext: context]) { @@ -165,7 +165,7 @@ static BOOL sendEMailNotifications = NO; if (secure) iCalString = [self secureContentAsString]; else - iCalString = content; + iCalString = [record objectForKey: @"c_content"]; if ([iCalString length] > 0) calendar = [iCalCalendar parseSingleFromSource: iCalString]; diff --git a/SoObjects/Contacts/SOGoContactGCSEntry.m b/SoObjects/Contacts/SOGoContactGCSEntry.m index b56e5a928..b4b8be092 100644 --- a/SoObjects/Contacts/SOGoContactGCSEntry.m +++ b/SoObjects/Contacts/SOGoContactGCSEntry.m @@ -48,8 +48,11 @@ - (NGVCard *) vCard { + NSString *content; + if (!card) { + content = [record objectForKey: @"c_content"]; if ([[content uppercaseString] hasPrefix: @"BEGIN:VCARD"]) card = [NGVCard parseSingleFromSource: content]; else diff --git a/SoObjects/Mailer/SOGoMailAccounts.m b/SoObjects/Mailer/SOGoMailAccounts.m index b09e9092b..515c66523 100644 --- a/SoObjects/Mailer/SOGoMailAccounts.m +++ b/SoObjects/Mailer/SOGoMailAccounts.m @@ -104,7 +104,7 @@ static NSString *AgenorShareLoginMarker = @".-."; /* first check attributes directly bound to the application */ if ((obj = [super lookupName:_key inContext:_ctx acquire:NO])) return obj; - + if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) { [self warnWithFormat:@ "User %@ tried to access mail hierarchy of %@", userLogin, [container nameInContainer]]; diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 6c38725f0..ec0c28036 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -850,7 +850,7 @@ static BOOL debugSoParts = NO; } else clazz = Nil; - + return [clazz objectWithName:_key inContainer: self]; } diff --git a/SoObjects/SOGo/SOGoContentObject.h b/SoObjects/SOGo/SOGoContentObject.h index 807b98745..3f4cb53ef 100644 --- a/SoObjects/SOGo/SOGoContentObject.h +++ b/SoObjects/SOGo/SOGoContentObject.h @@ -31,7 +31,7 @@ @interface SOGoContentObject : SOGoObject { NSString *ocsPath; - NSString *content; + NSDictionary *record; BOOL isNew; } diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index 9665eda90..4aa485035 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -49,9 +49,9 @@ if ((self = [super initWithName: newName inContainer: newContainer])) { ocsPath = nil; - content = [[self ocsFolder] fetchContentWithName: newName]; - [content retain]; - isNew = (!content); + record = [[self ocsFolder] recordOfEntryWithName: newName]; + [record retain]; + isNew = (!record); } return self; @@ -59,19 +59,11 @@ - (void) dealloc { - [content release]; + [record release]; [ocsPath release]; [super dealloc]; } -/* notifications */ - -- (void) sleep -{ - [content release]; content = nil; - [super sleep]; -} - /* accessors */ - (BOOL) isFolderish @@ -136,19 +128,25 @@ - (NSString *) contentAsString { - return content; + return [record objectForKey: @"c_content"]; } - (NSException *) saveContentString: (NSString *) newContent baseVersion: (unsigned int) newBaseVersion { /* Note: "iCal multifolder saves" are implemented in the apt subclass! */ - GCSFolder *folder; + GCSFolder *folder; NSException *ex; + NSMutableDictionary *newRecord; ex = nil; - ASSIGN (content, newContent); + if (record) + newRecord = [NSMutableDictionary dictionaryWithDictionary: record]; + else + newRecord = [NSMutableDictionary dictionary]; + [newRecord setObject: newContent forKey: @"c_content"]; + ASSIGN (record, newRecord); folder = [container ocsFolder]; if (folder) @@ -307,7 +305,7 @@ folder = [self ocsFolder]; if (folder) { - versionValue = [folder versionOfContentWithName: [self nameInContainer]]; + versionValue = [record objectForKey: @"c_version"]; sprintf (buf, "\"gcs%08d\"", [versionValue unsignedIntValue]); entityTag = [NSString stringWithCString: buf]; } @@ -325,7 +323,7 @@ { NSCalendarDate *date; - date = [[self ocsFolder] creationDateOfEntryWithName: nameInContainer]; + date = [record objectForKey: @"c_creationdate"]; return [date rfc822DateString]; } @@ -334,16 +332,19 @@ { NSCalendarDate *date; - date = [[self ocsFolder] lastModificationOfEntryWithName: nameInContainer]; + date = [record objectForKey: @"c_lastmodified"]; return [date rfc822DateString]; } - (NSString *) davContentLength { + NSString *content; + + content = [record objectForKey: @"c_content"]; + return [NSString stringWithFormat: @"%u", - [content - lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding]]; + [content lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding]]; } - (NSException *) davMoveToTargetObject: (id) _target