2005-07-15 Helge Hess <helge.hess@opengroupware.org>
- * SOGoMailFolder.m: fixed a stupid bug in permission parsing (v0.9.106)
+ * v0.9.107
-2005-07-15 Helge Hess <helge.hess@opengroupware.org>
+ * SOGoMailBodyPart.m: check lookup key path extension to determine the
+ part subclass to instantiate (note: the link generator in the UI
+ must generate proper links including the extension to make this work)
+
+ * added special part subclasses SOGoVCardMailBodyPart and
+ SOGoCalendarMailBodyPart
+
+ * SOGoMailObject.m: map vcf extension to vcard mime type, added some
+ debug logging
+
+ * SOGoMailFolder.m: fixed a stupid bug in permission parsing (v0.9.106)
* SOGoMailFolder.m: added support for more Cyrus permission flags
(v0.9.105)
-2005-07-15 Helge Hess <helge.hess@opengroupware.org>
-
* SOGoMailObject.m, SOGoMailBodyPart.m, SOGoDraftObject.m: fixed gcc4.0
warnings (v0.9.104)
SOGoMailBodyPart.m \
SOGoImageMailBodyPart.m \
SOGoMessageMailBodyPart.m \
+ SOGoCalendarMailBodyPart.m \
+ SOGoVCardMailBodyPart.m \
\
SOGoDraftsFolder.m \
SOGoDraftObject.m \
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include <Mailer/SOGoMailBodyPart.h>
+
+/*
+ SOGoCalendarMailBodyPart
+
+ A specialized SOGoMailBodyPart subclass for text/calendar attachments. Can
+ be used to attach special SoMethods.
+
+ See the superclass for more information on part objects.
+*/
+
+@interface SOGoCalendarMailBodyPart : SOGoMailBodyPart
+{
+}
+
+@end
+
+#include "common.h"
+
+@implementation SOGoCalendarMailBodyPart
+@end /* SOGoCalendarMailBodyPart */
return self;
/* return 404 to stop acquisition */
- return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */
+ reason:@"Did not find a subpart for the given name!"];
}
/* fetch */
[pe isEqualToString:@"png"] ||
[pe isEqualToString:@"jpg"])
return NSClassFromString(@"SOGoImageMailBodyPart");
+ if ([pe isEqualToString:@"ics"])
+ return NSClassFromString(@"SOGoCalendarMailBodyPart");
+ if ([pe isEqualToString:@"vcf"])
+ return NSClassFromString(@"SOGoVCardMailBodyPart");
+ break;
case 4:
if ([pe isEqualToString:@"mail"])
return NSClassFromString(@"SOGoMessageMailBodyPart");
+ break;
default:
return self;
}
+ return self;
}
/* debugging */
return;
}
+ // [self logWithFormat:@"GOT PERM: %@", rights];
+
self->somfFlags.didCheckMyRights = 1;
/* reset flags */
@implementation SOGoMailObject
static NSArray *coreInfoKeys = nil;
-static BOOL heavyDebug = NO;
-static BOOL debugOn = NO;
+static BOOL heavyDebug = NO;
+static BOOL debugOn = NO;
static BOOL debugBodyStructure = NO;
+static BOOL debugSoParts = NO;
+ (void)initialize {
/* Note: see SOGoMailManager.m for allowed IMAP4 keys */
mt = [_partInfo valueForKey:@"type"];
st = [[_partInfo valueForKey:@"subtype"] lowercaseString];
if ([mt isEqualToString:@"text"]) {
- if ([st isEqualToString:@"plain"])
- return @".txt";
- if ([st isEqualToString:@"html"])
- return @".html";
- if ([st isEqualToString:@"calendar"])
- return @".ics";
+ if ([st isEqualToString:@"plain"]) return @".txt";
+ if ([st isEqualToString:@"html"]) return @".html";
+ if ([st isEqualToString:@"calendar"]) return @".ics";
+ if ([st isEqualToString:@"x-vcard"]) return @".vcf";
}
else if ([mt isEqualToString:@"image"])
return [@"." stringByAppendingString:st];
/* lookup body part */
if ([self isBodyPartKey:_key inContext:_ctx]) {
- if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil)
+ if ((obj = [self lookupImap4BodyPartKey:_key inContext:_ctx]) != nil) {
+ if (debugSoParts)
+ [self logWithFormat:@"mail looked up part %@: %@", _key, obj];
return obj;
+ }
}
/* return 404 to stop acquisition */
- return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+ return [NSException exceptionWithHTTPStatus:404 /* Not Found */
+ reason:@"Did not find mail method or part-reference!"];
}
/* WebDAV */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include <Mailer/SOGoMailBodyPart.h>
+
+/*
+ SOGoVCardMailBodyPart
+
+ A specialized SOGoMailBodyPart subclass for text/x-vcard attachments. Can
+ be used to attach special SoMethods.
+
+ See the superclass for more information on part objects.
+*/
+
+@interface SOGoVCardMailBodyPart : SOGoMailBodyPart
+{
+}
+
+@end
+
+#include "common.h"
+
+@implementation SOGoVCardMailBodyPart
+@end /* SOGoVCardMailBodyPart */
# Version file
-SUBMINOR_VERSION:=106
+SUBMINOR_VERSION:=107
# v0.9.96 requires libNGMime v4.5.223
# v0.9.91 requires libNGMime v4.5.222
SOGoImageMailBodyPart = {
superclass = "SOGoMailBodyPart";
};
+ SOGoMessageMailBodyPart = {
+ superclass = "SOGoMailBodyPart";
+ };
+ SOGoCalendarMailBodyPart = {
+ superclass = "SOGoMailBodyPart";
+ };
+ SOGoVCardMailBodyPart = {
+ superclass = "SOGoMailBodyPart";
+ };
SOGoDraftsFolder = {
superclass = "SOGoMailBaseObject";