Monotone-Parent: ce39eb6f5a242085594929c2c6842540ff88d319

Monotone-Revision: d7b615d5687e4c138413b9ed635b046e284d5e5b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-02-08T15:35:11
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-02-08 15:35:11 +00:00
parent fb366a3101
commit 867767c121
5 changed files with 23 additions and 15 deletions
+8
View File
@@ -1,5 +1,13 @@
2008-02-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailBaseObject.m ([SOGoMailBaseObject
-isBodyPartKey:key]): hacked a little bit to test for the length
of the key trimmed from its bordering digits. So if the key
contains only digits, we consider it to be a body part key. There
is room for improvement but we can consider this will be accurate
in 99.99% of the cases. Also, removed the context parameter which
was useless.
* SoObjects/SOGo/SOGoObject.m ([SOGoObject
-davComplianceClassesInContext:localContext]): new method,
declaring "access-control" in the compliance classes.
+1 -1
View File
@@ -74,7 +74,7 @@
/* IMAP4 names */
- (BOOL) isBodyPartKey: (NSString *) _key inContext: (id) _ctx;
- (BOOL) isBodyPartKey: (NSString *) key;
@end
+12 -12
View File
@@ -19,6 +19,9 @@
02111-1307, USA.
*/
#import <Foundation/NSCharacterSet.h>
#import <Foundation/NSString.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
@@ -205,18 +208,15 @@ static BOOL debugOn = YES;
/* IMAP4 names */
- (BOOL)isBodyPartKey:(NSString *)_key inContext:(id)_ctx {
/*
Every key starting with a digit is considered an IMAP4 mime part key, used in
SOGoMailObject and SOGoMailBodyPart.
*/
if ([_key length] == 0)
return NO;
if (isdigit([_key characterAtIndex:0]))
return YES;
return NO;
#warning we could improve this by simply testing if the reference is the filename of an attachment or if the body part mentionned actually exists in the list of body parts. Another way is to use a prefix such as "attachment-*" to declare attachments.
- (BOOL) isBodyPartKey: (NSString *) key
{
NSString *trimmedKey;
trimmedKey = [key stringByTrimmingCharactersInSet:
[NSCharacterSet decimalDigitCharacterSet]];
return (![trimmedKey length]);
}
- (NSArray *) aclsForUser: (NSString *) uid
+1 -1
View File
@@ -206,7 +206,7 @@ static BOOL debugOn = NO;
if (!obj)
{
/* lookup body part */
if ([self isBodyPartKey:_key inContext:_ctx])
if ([self isBodyPartKey:_key])
obj = [self lookupImap4BodyPartKey:_key inContext:_ctx];
else if ([_key isEqualToString: @"asAttachment"])
[self setAsAttachment];
+1 -1
View File
@@ -866,7 +866,7 @@ static BOOL debugSoParts = NO;
/* lookup body part */
if ([self isBodyPartKey:_key inContext:_ctx]) {
if ([self isBodyPartKey:_key]) {
if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil) {
if (debugSoParts)
[self logWithFormat: @"mail looked up part %@: %@", _key, obj];