+2007-12-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
+ -aclsForUser:uid]): removed useless ACL checks on the current
+ object to reduce DB usage.
+
2007-12-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/MailerUI/UIxMailEditor.m ([UIxMailEditor -attachmentNames]):
+2007-12-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * NSString+NGCards.m ([NSString
+ -componentsWithSafeSeparator:separator]): new method that
+ separated the elements of a string into an array while avoiding
+ escaped instances of the separator passed as parameter.
+
2007-12-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalTimeZone.m ([iCalTimeZone -periodForDate:date]): at least
free (content);
content = NULL;
// NSLog (@"content: '%@'", s);
- contentValues = [s componentsSeparatedByString: @";"];
+ contentValues = [s componentsWithSafeSeparator: ';'];
}
else
contentValues = nil;
else
{
/* increase content */
- content =
+ content =
realloc (content, (contentLength + _len+2) * sizeof(unichar));
memcpy (&(content[contentLength]), _chars,
(_len * sizeof(unichar)));
#import <Foundation/NSString.h>
+@class NSArray;
@class NSCalendarDate;
@class NSTimeZone;
- (NSCalendarDate *) asCalendarDate;
- (BOOL) isAllDayDate;
-- (NSArray *) commaSeparatedValues;
+- (NSArray *) componentsWithSafeSeparator: (unichar) separator;
@end
return ([self length] == 8);
}
-- (NSArray *) commaSeparatedValues
+- (NSArray *) componentsWithSafeSeparator: (unichar) separator
{
- NSEnumerator *rawValues;
- NSMutableArray *values;
- NSString *currentValue, *newValue;
+ NSMutableArray *components;
+ NSRange currentRange;
+ unichar *stringBuffer;
+ unichar currentChar;
+ unsigned int count, length;
+ BOOL escaped;
- values = [NSMutableArray new];
- [values autorelease];
+ components = [NSMutableArray array];
+
+ length = [self length];
+ stringBuffer = malloc (sizeof (unichar) * length);
+ [self getCharacters: stringBuffer];
- rawValues = [[self componentsSeparatedByString: @","] objectEnumerator];
- currentValue = [rawValues nextObject];
- while (currentValue)
+ currentRange = NSMakeRange(0, 0);
+ escaped = NO;
+ count = 0;
+ while (count < length)
{
- newValue = [currentValue stringByTrimmingSpaces];
- if ([newValue length])
- [values addObject: newValue];
- currentValue = [rawValues nextObject];
+ if (escaped)
+ currentRange.length++;
+ else
+ {
+ currentChar = *(stringBuffer + count);
+ if (currentChar == '\\')
+ escaped = YES;
+ else if (currentChar == separator)
+ {
+ [components
+ addObject: [self substringWithRange: currentRange]];
+ currentRange = NSMakeRange (count + 1, 0);
+ }
+ else
+ currentRange.length++;
+ }
+ count++;
}
+ [components
+ addObject: [self substringWithRange: currentRange]];
- return values;
+ free (stringBuffer);
+
+ return components;
}
@end
NSArray *ownAcls, *containerAcls;
acls = [NSMutableArray array];
- ownAcls = [container aclsForUser: uid
- forObjectAtPath: [self pathArrayToSOGoObject]];
- [acls addObjectsFromArray: ownAcls];
+ /* this is unused... */
+// ownAcls = [container aclsForUser: uid
+// forObjectAtPath: [self pathArrayToSOGoObject]];
+// [acls addObjectsFromArray: ownAcls];
containerAcls = [container aclsForUser: uid];
if ([containerAcls count] > 0)
{
- (void) dealloc
{
- [snapshot release];
+ [snapshot release];
[preferredEmail release];
[super dealloc];
}
/* load/store content format */
-- (void) _fixupSnapshot
-{
- // TODO: perform sanity checking, eg build CN on demand
- NSString *cn, *gn, *sn;
-
- cn = [snapshot objectForKey: @"cn"];
- gn = [snapshot objectForKey: @"givenName"];
- sn = [snapshot objectForKey: @"sn"];
-
- if (![sn isNotNull] || [sn length] == 0)
- sn = nil;
- if (![cn isNotNull] || [cn length] == 0)
- cn = nil;
-
- if (sn == nil) {
- if (cn == nil)
- sn = @"[noname]";
- else {
- // TODO: need a better name parser here
- NSRange r;
-
- r = [cn rangeOfString: @" "];
- sn = (r.length > 0)
- ? [cn substringFromIndex:(r.location + r.length)]
- : cn;
- }
- [snapshot setObject:sn forKey: @"sn"];
- }
- if (sn == nil && gn == nil)
- cn = @"[noname]";
- else if (sn == nil)
- cn = gn;
- else if (gn == nil)
- cn = sn;
- else
- cn = [[gn stringByAppendingString: @" "] stringByAppendingString:sn];
- [snapshot setObject:cn forKey: @"cn"];
-}
+// - (void) _fixupSnapshot
+// {
+// NSString *currentKey, *currentString;
+// NSMutableString *newString;
+// NSArray *keys;
+// unsigned int count, max;
+
+// keys = [snapshot allKeys];
+// max = [keys count];
+// for (count = 0; count < max; count++)
+// {
+// currentKey = [keys objectAtIndex: count];
+// currentString = [snapshot objectForKey: currentKey];
+// newString = [currentString mutableCopy];
+// [newString autorelease];
+// [newString replaceString: @";" withString: @"\\;"];
+// if (![newString isEqualToString: currentString])
+// [snapshot setObject: newString forKey: currentKey];
+// }
+// }
/* helper */
card = [contact vCard];
if (card)
{
+// [self _fixupSnapshot];
[self _saveSnapshot];
[contact save];
ASSIGN (privacy, [component accessClass]);
ASSIGN (priority, [component priority]);
ASSIGN (status, [component status]);
- ASSIGN (categories, [[component categories] commaSeparatedValues]);
+ ASSIGN (categories,
+ [[component categories] componentsWithSafeSeparator: ',']);
ASSIGN (organizer, [component organizer]);
[self _loadCategories];
[self _loadAttendees];
TABLE#messageList TD,
TABLE#messageList TH
-{ height: 1.2em;
+{ height: 20px;
overflow: hidden;
white-space: nowrap; }
{ width: 22px;
text-align: center; }
+TABLE#messageList TD.messageFlagColumn IMG
+{ width: 14px;
+ height: 14px; }
+
TD#subjectHeader,
TABLE#messageList TD.tbtv_subject_headercell,
TABLE#messageList TD.mailer_unreadmailsubject,