Monotone-Parent: 1fb3121c84e0bb2773973fcfde109c7b26530951
Monotone-Revision: e2f910a1982b774a3f5dfd586d968821441f2076 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-08-17T17:56:25 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
90e226d5bb
commit
fb297c913c
|
@ -1,3 +1,9 @@
|
|||
2012-08-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreContext.m (-getPath:ofFMID:inMemCtx:):
|
||||
properly escape urls containing non-ascii chars.
|
||||
(-getRootFoldeR:withFID:): idem.
|
||||
|
||||
2012-08-16 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* OpenChange/MAPIStoreCalendarMessage.m
|
||||
|
|
|
@ -366,7 +366,8 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
NSString *objectURL, *url;
|
||||
// TDB_DATA key, dbuf;
|
||||
|
||||
url = [contextUrl absoluteString];
|
||||
url = [[contextUrl absoluteString]
|
||||
stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
|
||||
objectURL = [[userContext mapping] urlFromID: fmid];
|
||||
if (objectURL)
|
||||
{
|
||||
|
@ -417,15 +418,18 @@ static inline NSURL *CompleteURLFromMapistoreURI (const char *uri)
|
|||
MAPIStoreFolder *baseFolder;
|
||||
SOGoFolder *currentFolder;
|
||||
WOContext *woContext;
|
||||
NSString *path;
|
||||
NSString *path, *urlString;
|
||||
NSArray *pathComponents;
|
||||
NSUInteger count, max;
|
||||
|
||||
mapping = [userContext mapping];
|
||||
if (![mapping urlFromID: newFid])
|
||||
[mapping registerURL: [contextUrl absoluteString]
|
||||
withID: newFid];
|
||||
|
||||
{
|
||||
urlString = [[contextUrl absoluteString]
|
||||
stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
|
||||
[mapping registerURL: urlString
|
||||
withID: newFid];
|
||||
}
|
||||
[userContext activateWithUser: activeUser];
|
||||
woContext = [userContext woContext];
|
||||
|
||||
|
|
|
@ -94,12 +94,14 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
{
|
||||
NSURL *folderURL;
|
||||
NSMutableString *pathPrefix;
|
||||
NSString *path, *folderName;
|
||||
NSString *path, *escapedURL, *folderName;
|
||||
NSArray *parts;
|
||||
NSUInteger lastPartIdx;
|
||||
MAPIStoreUserContext *userContext;
|
||||
|
||||
folderURL = [NSURL URLWithString: [self url]];
|
||||
escapedURL = [[self url]
|
||||
stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
|
||||
folderURL = [NSURL URLWithString: escapedURL];
|
||||
path = [folderURL path];
|
||||
path = [path substringFromIndex: 1];
|
||||
if ([path length] > 0)
|
||||
|
@ -1495,7 +1497,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
|
|||
url = [NSString stringWithFormat: @"%@/", [super url]];
|
||||
else
|
||||
{
|
||||
url = [[context url] absoluteString];
|
||||
url = [[[context url] absoluteString]
|
||||
stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
|
||||
if (![url hasSuffix: @"/"])
|
||||
url = [NSString stringWithFormat: @"%@/", url];
|
||||
}
|
||||
|
|
|
@ -206,12 +206,14 @@ MakeDisplayFolderName (NSString *folderName)
|
|||
|
||||
- (void) updateURLWithFolderName: (NSString *) newFolderName
|
||||
{
|
||||
NSString *urlString;
|
||||
NSString *urlString, *escapedName;
|
||||
NSMutableArray *pathComponents;
|
||||
BOOL hasSlash;
|
||||
NSUInteger max, folderNameIdx;
|
||||
NSURL *newURL;
|
||||
|
||||
/* we do not need to unescape the url here as it will be reassembled later
|
||||
in the method */
|
||||
urlString = [contextUrl absoluteString];
|
||||
hasSlash = [urlString hasSuffix: @"/"];
|
||||
pathComponents = [[urlString componentsSeparatedByString: @"/"]
|
||||
|
@ -222,8 +224,9 @@ MakeDisplayFolderName (NSString *folderName)
|
|||
folderNameIdx = max - 2;
|
||||
else
|
||||
folderNameIdx = max - 1;
|
||||
escapedName = [newFolderName stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
|
||||
[pathComponents replaceObjectAtIndex: folderNameIdx
|
||||
withObject: [newFolderName stringByEscapingURL]];
|
||||
withObject: escapedName];
|
||||
urlString = [pathComponents componentsJoinedByString: @"/"];
|
||||
newURL = [NSURL URLWithString: urlString];
|
||||
ASSIGN (contextUrl, newURL);
|
||||
|
|
|
@ -1046,15 +1046,15 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
|||
folderURL = [sogoObject imap4URL];
|
||||
if (!newFolderName)
|
||||
newFolderName = [sogoObject displayName];
|
||||
newFolderName = [newFolderName stringByEscapingURL];
|
||||
targetSOGoFolder = [targetFolder sogoObject];
|
||||
newFolderURL = [NSURL URLWithString: newFolderName
|
||||
relativeToURL: [targetSOGoFolder imap4URL]];
|
||||
if (isMove)
|
||||
{
|
||||
newFolderURL = [NSURL
|
||||
URLWithString: [newFolderName stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]
|
||||
relativeToURL: [targetSOGoFolder imap4URL]];
|
||||
error = [[sogoObject imap4Connection]
|
||||
moveMailboxAtURL: folderURL
|
||||
toURL: newFolderURL];
|
||||
moveMailboxAtURL: folderURL
|
||||
toURL: newFolderURL];
|
||||
if (error)
|
||||
rc = MAPISTORE_ERR_DENIED;
|
||||
else
|
||||
|
@ -1063,8 +1063,7 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
|
|||
mapping = [self mapping];
|
||||
newURL = [NSString stringWithFormat: @"%@folder%@/",
|
||||
[targetFolder url], newFolderName];
|
||||
[mapping updateID: [self objectId]
|
||||
withURL: newURL];
|
||||
[mapping updateID: [self objectId] withURL: newURL];
|
||||
parentDBFolderPath = [[targetFolder dbFolder] path];
|
||||
if (!parentDBFolderPath)
|
||||
parentDBFolderPath = @"";
|
||||
|
|
Loading…
Reference in New Issue