mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-18 21:23:20 +00:00
Monotone-Parent: e4af1bcb0f6a6fc58eedf3cbb01b463d2b262c00
Monotone-Revision: e8b5a9f2cdf8cecaf58804b50b6324d1e330a8cb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-28T16:10:58 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -422,29 +422,18 @@ static SoSecurityManager *sm = nil;
|
||||
- (NSString *) _fixedWebCalendarKey: (NSString *) oldKey
|
||||
{
|
||||
NSString *newKey;
|
||||
NSRange lastOccurrence, fullOccurrence;
|
||||
NSRange lastOccurrence;
|
||||
|
||||
lastOccurrence = [oldKey rangeOfString: @":Calendar/"
|
||||
options: NSBackwardsSearch];
|
||||
if ([oldKey rangeOfString: @":Calendar/"].location != lastOccurrence.location)
|
||||
if ([oldKey rangeOfString: @":Calendar/"].location
|
||||
!= lastOccurrence.location)
|
||||
{
|
||||
fullOccurrence
|
||||
= [oldKey rangeOfString:
|
||||
[NSString stringWithFormat: @"%@:Calendar/",
|
||||
owner]
|
||||
options: NSBackwardsSearch];
|
||||
if (fullOccurrence.location != NSNotFound)
|
||||
{
|
||||
newKey = [oldKey substringFromIndex: fullOccurrence.location];
|
||||
[self logWithFormat: @"fixed erroneous calendar key: '%@' -> '%@'",
|
||||
oldKey, newKey];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self errorWithFormat: @"calendar key cannot be fixed: '%@'",
|
||||
oldKey];
|
||||
newKey = nil;
|
||||
}
|
||||
newKey
|
||||
= [NSString stringWithFormat: @"%@%@", owner,
|
||||
[oldKey substringFromIndex: lastOccurrence.location]];
|
||||
[self logWithFormat: @"fixed erroneous calendar key: '%@' -> '%@'",
|
||||
oldKey, newKey];
|
||||
}
|
||||
else
|
||||
newKey = nil;
|
||||
|
||||
Reference in New Issue
Block a user