2005-01-31 Helge Hess <helge.hess@opengroupware.org>
+ * SOGoMailObject.m: moved in plain/text bulk fetch method from mail
+ viewer (since it is general purpose) (v0.9.63)
+
* SOGoMailObject.m: properly handle part lookup in the context of
embedded message/rfc822 content (v0.9.62)
- (NSData *)content;
- (NSString *)contentAsString;
+/* bulk fetching of plain/text content */
+
+- (NSArray *)plainTextContentFetchKeys;
+
/* flags */
- (NSException *)addFlags:(id)_f;
return [s autorelease];
}
+/* bulk fetching of plain/text content */
+
+- (BOOL)shouldFetchPartOfType:(NSString *)_type subtype:(NSString *)_subtype {
+ _type = [_type lowercaseString];
+ _subtype = [_subtype lowercaseString];
+
+ if ([_type isEqualToString:@"text"])
+ return [_subtype isEqualToString:@"plain"];
+ return NO;
+}
+
+- (void)addRequiredKeysOfStructure:(id)_info path:(NSString *)_p
+ toArray:(NSMutableArray *)_keys
+{
+ NSArray *parts;
+ unsigned i, count;
+ BOOL fetchPart;
+ id body;
+
+ fetchPart = [self shouldFetchPartOfType:[_info valueForKey:@"type"]
+ subtype:[_info valueForKey:@"subtype"]];
+ if (fetchPart) {
+ NSString *k;
+
+ if ([_p length] > 0) {
+ k = [[@"body[" stringByAppendingString:_p] stringByAppendingString:@"]"];
+ }
+ else {
+ /*
+ for some reason we need to add ".TEXT" for plain text stuff on root
+ entities?
+ TODO: check with HTML
+ */
+ k = @"body[text]";
+ }
+ [_keys addObject:k];
+ }
+
+ /* recurse */
+
+ parts = [_info objectForKey:@"parts"];
+ for (i = 0, count = [parts count]; i < count; i++) {
+ NSString *sp;
+ id childInfo;
+
+ sp = [_p length] > 0
+ ? [_p stringByAppendingFormat:@".%d", i + 1]
+ : [NSString stringWithFormat:@"%d", i + 1];
+
+ childInfo = [parts objectAtIndex:i];
+
+ [self addRequiredKeysOfStructure:childInfo path:sp toArray:_keys];
+ }
+
+ /* check body */
+
+ if ((body = [_info objectForKey:@"body"]) != nil) {
+ NSString *sp;
+
+ sp = [[body valueForKey:@"type"] lowercaseString];
+ if ([sp isEqualToString:@"multipart"])
+ sp = _p;
+ else
+ sp = [_p length] > 0 ? [_p stringByAppendingString:@".1"] : @"1";
+ [self addRequiredKeysOfStructure:body path:sp toArray:_keys];
+ }
+}
+
+- (NSArray *)plainTextContentFetchKeys {
+ NSMutableArray *ma;
+
+ ma = [NSMutableArray arrayWithCapacity:4];
+ [self addRequiredKeysOfStructure:[[self clientObject] bodyStructure]
+ path:@"" toArray:ma];
+ return ma;
+}
+
/* flags */
- (NSException *)addFlags:(id)_flags {
# Version file
-SUBMINOR_VERSION:=62
+SUBMINOR_VERSION:=63
# v0.9.55 requires NGExtensions v4.5.136
# v0.9.44 requires libNGMime v4.3.194
2005-01-31 Helge Hess <helge.hess@opengroupware.org>
+ * UIxMailView.m: moved plain/text bulkfetch method to SoObjects/Mailer,
+ since its general purpose (v0.9.85)
+
* v0.9.84
* UIxMailView.m: properly recurse into message/rfc822 bodies for flat
/* process body structure */
-- (BOOL)shouldFetchPartOfType:(NSString *)_type subtype:(NSString *)_subtype {
- _type = [_type lowercaseString];
- _subtype = [_subtype lowercaseString];
-
- if ([_type isEqualToString:@"text"])
- return [_subtype isEqualToString:@"plain"];
- return NO;
-}
-
-- (void)addRequiredKeysOfStructure:(id)_info path:(NSString *)_p
- toArray:(NSMutableArray *)_keys
-{
- NSArray *parts;
- unsigned i, count;
- BOOL fetchPart;
- id body;
-
- fetchPart = [self shouldFetchPartOfType:[_info valueForKey:@"type"]
- subtype:[_info valueForKey:@"subtype"]];
- if (fetchPart) {
- NSString *k;
-
- if ([_p length] > 0) {
- k = [[@"body[" stringByAppendingString:_p] stringByAppendingString:@"]"];
- }
- else {
- /*
- for some reason we need to add ".TEXT" for plain text stuff on root
- entities?
- TODO: check with HTML
- */
- k = @"body[text]";
- }
- [_keys addObject:k];
- }
-
- /* recurse */
-
- parts = [_info objectForKey:@"parts"];
- for (i = 0, count = [parts count]; i < count; i++) {
- NSString *sp;
- id childInfo;
-
- sp = [_p length] > 0
- ? [_p stringByAppendingFormat:@".%d", i + 1]
- : [NSString stringWithFormat:@"%d", i + 1];
-
- childInfo = [parts objectAtIndex:i];
-
- [self addRequiredKeysOfStructure:childInfo path:sp toArray:_keys];
- }
-
- /* check body */
-
- if ((body = [_info objectForKey:@"body"]) != nil) {
- NSString *sp;
-
- sp = [[body valueForKey:@"type"] lowercaseString];
- if ([sp isEqualToString:@"multipart"])
- sp = _p;
- else
- sp = [_p length] > 0 ? [_p stringByAppendingString:@".1"] : @"1";
- [self addRequiredKeysOfStructure:body path:sp toArray:_keys];
- }
-}
-
-- (NSArray *)contentFetchKeys {
- NSMutableArray *ma;
-
- ma = [NSMutableArray arrayWithCapacity:4];
- [self addRequiredKeysOfStructure:[[self clientObject] bodyStructure]
- path:@"" toArray:ma];
- return ma;
-}
-
- (NSDictionary *)fetchFlatContents {
NSMutableDictionary *flatContents;
unsigned i, count;
NSArray *keys;
id result;
- keys = [self contentFetchKeys];
+ keys = [[self clientObject] plainTextContentFetchKeys];
[self debugWithFormat:@"fetch keys: %@", keys];
result = [[self clientObject] fetchParts:keys];
reason:@"did not find specified message!"];
}
#if 0
- [self logWithFormat:@"FETCH BODY PARTS: %@", [self contentFetchKeys]];
+ [self logWithFormat:@"FETCH BODY PARTS: %@",
+ [[self clientObject] plainTextContentFetchKeys]];
[self logWithFormat:@"CORE: %@", [self fetchFlatContents]];
#endif
return self;
# version file
-SUBMINOR_VERSION:=84
+SUBMINOR_VERSION:=85
+# v0.9.85 requires SoObjects/Mailer v0.9.63
# v0.9.84 requires libNGMime v4.5.209
# v0.9.81 requires SoObjects/Sieve v0.9.5
# v0.9.80 requires SoObjects/Mailer v0.9.59
cssClass = "tbicon_compose"; label = "Write"; },
),
( // second group
-/* TODO: enable when implemented
+///* TODO: enable when implemented
{ link = "reply";
cssClass = "tbicon_reply"; label = "Reply"; },
{ link = "replyall";
cssClass = "tbicon_replyall"; label = "Reply All"; },
-*/
+//*/
{ link = "forward";
cssClass = "tbicon_forward"; label = "Forward"; },
),