Monotone-Parent: a2b85224aedbae3b50dca9ad2d087e281dc1ee27
Monotone-Revision: 77306d05ac643771e7993895fdcd2955485ad2d2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-01T05:45:12 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
01f43b5944
commit
a5380039b4
10
ChangeLog
10
ChangeLog
|
@ -1,5 +1,15 @@
|
|||
2007-06-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder
|
||||
-initWithName:newNameinContainer:newContainer]): new overriden
|
||||
method setting the custom owner directly.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailAccounts.m ([SOGoMailAccounts
|
||||
-davContentType]): same as below.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount
|
||||
-davContentType]): same as below.
|
||||
|
||||
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder -davContentType]):
|
||||
declare "httpd/unix-directory".
|
||||
|
||||
|
|
|
@ -387,15 +387,24 @@ static BOOL useAltNamespace = NO;
|
|||
|
||||
/* WebDAV */
|
||||
|
||||
- (BOOL)davIsCollection {
|
||||
- (NSString *) davContentType
|
||||
{
|
||||
return @"httpd/unix-directory";
|
||||
}
|
||||
|
||||
- (BOOL) davIsCollection
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSException *)davCreateCollection:(NSString *)_name inContext:(id)_ctx {
|
||||
- (NSException *) davCreateCollection: (NSString *) _name
|
||||
inContext: (id) _ctx
|
||||
{
|
||||
return [[self imap4Connection] createMailbox:_name atURL:[self imap4URL]];
|
||||
}
|
||||
|
||||
- (NSString *)shortTitle {
|
||||
- (NSString *) shortTitle
|
||||
{
|
||||
NSString *s, *login, *host;
|
||||
NSRange r;
|
||||
|
||||
|
@ -425,7 +434,8 @@ static BOOL useAltNamespace = NO;
|
|||
return [NSString stringWithFormat:@"%@@%@", login, host];
|
||||
}
|
||||
|
||||
- (NSString *)davDisplayName {
|
||||
- (NSString *) davDisplayName
|
||||
{
|
||||
return [self shortTitle];
|
||||
}
|
||||
|
||||
|
|
|
@ -185,6 +185,11 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (NSString *) davContentType
|
||||
{
|
||||
return @"httpd/unix-directory";
|
||||
}
|
||||
|
||||
/* acls */
|
||||
|
||||
- (NSArray *) aclsForUser: (NSString *) uid
|
||||
|
|
|
@ -62,6 +62,39 @@ static BOOL useAltNamespace = NO;
|
|||
useAltNamespace = [ud boolForKey:@"SOGoSpecialFoldersInRoot"];
|
||||
}
|
||||
|
||||
- (void) _adjustOwner
|
||||
{
|
||||
SOGoMailAccount *mailAccount;
|
||||
NSString *path;
|
||||
NSArray *names;
|
||||
|
||||
mailAccount = [self mailAccountFolder];
|
||||
path = [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]];
|
||||
|
||||
if ([path hasPrefix: [mailAccount sharedFolderName]])
|
||||
owner = @"anyone";
|
||||
else if ([path hasPrefix: [mailAccount otherUsersFolderName]])
|
||||
{
|
||||
names = [path componentsSeparatedByString: @"/"];
|
||||
if ([names count] > 1)
|
||||
owner = [names objectAtIndex: 1];
|
||||
else
|
||||
owner = @"anyone";
|
||||
}
|
||||
}
|
||||
|
||||
- (id) initWithName: (NSString *) newName
|
||||
inContainer: (id) newContainer
|
||||
{
|
||||
if ((self = [super initWithName: newName
|
||||
inContainer: newContainer]))
|
||||
{
|
||||
[self _adjustOwner];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[filenames release];
|
||||
|
@ -115,6 +148,11 @@ static BOOL useAltNamespace = NO;
|
|||
return subfoldersURL;
|
||||
}
|
||||
|
||||
- (NSString *) davContentType
|
||||
{
|
||||
return @"httpd/unix-directory";
|
||||
}
|
||||
|
||||
- (NSArray *) toOneRelationshipKeys
|
||||
{
|
||||
NSArray *uids;
|
||||
|
@ -562,31 +600,6 @@ static BOOL useAltNamespace = NO;
|
|||
return defaultUserID;
|
||||
}
|
||||
|
||||
- (NSString *) ownerInContext: (WOContext *) localContext
|
||||
{
|
||||
SOGoMailAccount *mailAccount;
|
||||
NSString *path, *owner;
|
||||
NSArray *names;
|
||||
|
||||
mailAccount = [self mailAccountFolder];
|
||||
path = [[self imap4Connection] imap4FolderNameForURL: [self imap4URL]];
|
||||
|
||||
if ([path hasPrefix: [mailAccount sharedFolderName]])
|
||||
owner = @"anyone";
|
||||
else if ([path hasPrefix: [mailAccount otherUsersFolderName]])
|
||||
{
|
||||
names = [path componentsSeparatedByString: @"/"];
|
||||
if ([names count] > 1)
|
||||
owner = [names objectAtIndex: 1];
|
||||
else
|
||||
owner = @"anyone";
|
||||
}
|
||||
else
|
||||
owner = [super ownerInContext: localContext];
|
||||
|
||||
return owner;
|
||||
}
|
||||
|
||||
- (NSString *) otherUsersPathToFolder
|
||||
{
|
||||
NSString *userPath, *selfPath, *otherUsers, *sharedFolders;
|
||||
|
@ -604,8 +617,7 @@ static BOOL useAltNamespace = NO;
|
|||
else
|
||||
userPath = [NSString stringWithFormat: @"/%@/%@%@",
|
||||
[otherUsers stringByEscapingURL],
|
||||
[self ownerInContext: context],
|
||||
selfPath];
|
||||
owner, selfPath];
|
||||
|
||||
return userPath;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue