mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-29 15:15:37 +00:00
Monotone-Parent: 03b2ef9088f0831bd7c90128bf63ead3ee3f82a8
Monotone-Revision: d7fa74829c523fd87dd6cb456ed8fb4b12564db0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-06-30T19:10:28 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1364,57 +1364,6 @@ _prepareContextClass (struct mapistore_context *newMemCtx,
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (int) getFoldersList: (struct indexing_folders_list **) folders_list
|
||||
withFMID: (uint64_t) fmid
|
||||
{
|
||||
int rc;
|
||||
NSString *currentURL, *url;
|
||||
NSMutableArray *nsFolderList;
|
||||
uint64_t fid;
|
||||
|
||||
[self logWithFormat: @"METHOD '%s' -- fmid: 0x%.16x", __FUNCTION__, fmid];
|
||||
|
||||
rc = MAPI_E_SUCCESS;
|
||||
|
||||
url = [contextUrl absoluteString];
|
||||
currentURL = [mapping urlFromID: fmid];
|
||||
if (currentURL && ![currentURL isEqualToString: url]
|
||||
&& [currentURL hasPrefix: url])
|
||||
{
|
||||
nsFolderList = [NSMutableArray arrayWithCapacity: 32];
|
||||
[self extractChildNameFromURL: currentURL
|
||||
andFolderURLAt: ¤tURL];
|
||||
while (currentURL && rc == MAPI_E_SUCCESS
|
||||
&& ![currentURL isEqualToString: url])
|
||||
{
|
||||
fid = [mapping idFromURL: currentURL];
|
||||
if (fid == NSNotFound)
|
||||
{
|
||||
[self logWithFormat: @"no fid found for url '%@'", currentURL];
|
||||
rc = MAPI_E_NOT_FOUND;
|
||||
}
|
||||
else
|
||||
{
|
||||
[nsFolderList addObject: [NSNumber numberWithUnsignedLongLong: fid]];
|
||||
[self extractChildNameFromURL: currentURL
|
||||
andFolderURLAt: ¤tURL];
|
||||
}
|
||||
}
|
||||
|
||||
if (rc != MAPI_E_NOT_FOUND)
|
||||
{
|
||||
fid = [mapping idFromURL: url];
|
||||
[nsFolderList addObject: [NSNumber numberWithUnsignedLongLong: fid]];
|
||||
[self logWithFormat: @"resulting folder list: %@", nsFolderList];
|
||||
*folders_list = [nsFolderList asFoldersListInCtx: memCtx];
|
||||
}
|
||||
}
|
||||
else
|
||||
rc = MAPI_E_NOT_FOUND;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* utils */
|
||||
|
||||
- (NSString *) extractChildNameFromURL: (NSString *) objectURL
|
||||
|
||||
Reference in New Issue
Block a user