mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-03 18:45:26 +00:00
Monotone-Parent: 9bf93635e40d613a05f206aeb8112565d864bdcd
Monotone-Revision: 975188efc102040c8f1f704d2084d9798480bcb8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-08-09T08:20:49 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2008-08-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Mailer/SOGoMailBodyPart.m ([SOGoMailBodyPart
|
||||
-lookupImap4BodyPartKey:inContext:]): find a class based on the
|
||||
mime type of the subpart described by the partInfo.
|
||||
|
||||
* SoObjects/Appointments/iCalEntityObject+SOGo.m
|
||||
([iCalEntityObject
|
||||
-quickRecordDateAsNumber:_datewithOffset:offsetforAllDay:allDay]):
|
||||
|
||||
@@ -149,15 +149,35 @@ static BOOL debugOn = NO;
|
||||
|
||||
/* name lookup */
|
||||
|
||||
- (id) lookupImap4BodyPartKey: (NSString *) _key
|
||||
inContext: (id) _ctx
|
||||
- (id) lookupImap4BodyPartKey: (NSString *) key
|
||||
inContext: (WOContext *) localContext
|
||||
{
|
||||
// TODO: we might want to check for existence prior controller creation
|
||||
Class clazz;
|
||||
|
||||
clazz = [SOGoMailBodyPart bodyPartClassForKey:_key inContext:_ctx];
|
||||
NSArray *subParts;
|
||||
unsigned int nbr;
|
||||
id obj;
|
||||
NSDictionary *subPart;
|
||||
|
||||
return [clazz objectWithName: _key inContainer: self];
|
||||
nbr = [key intValue];
|
||||
subParts = [[self partInfo] objectForKey: @"parts"];
|
||||
if (nbr > 0 && nbr < ([subParts count] + 1))
|
||||
{
|
||||
subPart = [subParts objectAtIndex: nbr - 1];
|
||||
clazz
|
||||
= [[self class] bodyPartClassForMimeType:
|
||||
[subPart keysWithFormat: @"%{type}/%{subtype}"]
|
||||
inContext: localContext];
|
||||
obj = [clazz objectWithName: key inContainer: self];
|
||||
}
|
||||
else
|
||||
obj = self;
|
||||
|
||||
return obj;
|
||||
// clazz = [SOGoMailBodyPart bodyPartClassForKey: _key
|
||||
// inContext: _ctx];
|
||||
|
||||
// return [clazz objectWithName: _key inContainer: self];
|
||||
}
|
||||
|
||||
- (NSString *) filename
|
||||
@@ -200,14 +220,14 @@ static BOOL debugOn = NO;
|
||||
acquire: (BOOL) _flag
|
||||
{
|
||||
id obj;
|
||||
|
||||
|
||||
/* first check attributes directly bound to the application */
|
||||
obj = [super lookupName:_key inContext:_ctx acquire:NO];
|
||||
if (!obj)
|
||||
{
|
||||
/* lookup body part */
|
||||
if ([self isBodyPartKey:_key])
|
||||
obj = [self lookupImap4BodyPartKey:_key inContext:_ctx];
|
||||
if ([self isBodyPartKey: _key])
|
||||
obj = [self lookupImap4BodyPartKey: _key inContext: _ctx];
|
||||
else if ([_key isEqualToString: @"asAttachment"])
|
||||
[self setAsAttachment];
|
||||
/* should check whether such a filename exist in the attached names */
|
||||
|
||||
Reference in New Issue
Block a user