From d52a73e213fb80e61c15f60b818a422ecace1dd2 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 31 Mar 2011 22:02:03 +0000 Subject: [PATCH] Monotone-Parent: b83ff01eca261864bff271ab6ff07aa383d06b85 Monotone-Revision: e3553800558b6ad8617dd801a3ff4822695f8d62 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2011-03-31T22:02:03 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 ++ OpenChange/MAPIStoreEmbeddedMessage.h | 40 +++++++++++++++++ OpenChange/MAPIStoreEmbeddedMessage.m | 62 +++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 OpenChange/MAPIStoreEmbeddedMessage.h create mode 100644 OpenChange/MAPIStoreEmbeddedMessage.m diff --git a/ChangeLog b/ChangeLog index 47373bb32..ecb47ba74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-03-31 Wolfgang Sourdeau + * OpenChange/MAPIStoreEmbeddedMessage.[hm]: new class module for + attachment embedded messages. + * OpenChange/MAPIStoreObject.m (-url): make use of -[MAPIStoreObject nameInContainer] rather than the equivalent on SOGoObject to make that code reusable for objects that are not diff --git a/OpenChange/MAPIStoreEmbeddedMessage.h b/OpenChange/MAPIStoreEmbeddedMessage.h new file mode 100644 index 000000000..431f60e80 --- /dev/null +++ b/OpenChange/MAPIStoreEmbeddedMessage.h @@ -0,0 +1,40 @@ +/* MAPIStoreEmbeddedMessage.h - this file is part of SOGo + * + * Copyright (C) 2011 Inverse inc + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef MAPISTOREEMBEDDEDMESSAGE_H +#define MAPISTOREEMBEDDEDMESSAGE_H + +#import "MAPIStoreMessage.h" + +@interface MAPIStoreEmbeddedMessage : MAPIStoreMessage +{ + id attachment; +} + ++ (id) embeddedMessageWithAttachment: (id) newAttachment; + +- (id) initWithAttachment: (id) newAttachment; + +@end + + +#endif /* MAPISTOREEMBEDDEDMESSAGE_H */ diff --git a/OpenChange/MAPIStoreEmbeddedMessage.m b/OpenChange/MAPIStoreEmbeddedMessage.m new file mode 100644 index 000000000..877c287b8 --- /dev/null +++ b/OpenChange/MAPIStoreEmbeddedMessage.m @@ -0,0 +1,62 @@ +/* MAPIStoreEmbeddedMessage.m - this file is part of SOGo + * + * Copyright (C) 2011 Inverse inc + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import "MAPIStoreEmbeddedMessage.h" + +static Class MAPIStoreAttachmentK; + +@implementation MAPIStoreEmbeddedMessage + ++ (void) initialize +{ + MAPIStoreAttachmentK = [MAPIStoreAttachment class]; +} + ++ (id) embeddedMessageWithAttachment: (id) newAttachment +{ + MAPIStoreEmbeddedMessage *newMessage; + + newMessage = [[self alloc] initWithAttachment: newAttachment]; + [newMessage autorelease]; + + return newMessage; +} + +- (id) initWithAttachment: (id) newAttachment +{ + if ((self = [self init])) + { + if ([newAttachment isKindOfClass: MAPIStoreAttachmentK]) + ASSIGN (container, newAttachment); + } + + return self; +} + +- (NSString *) nameInContainer +{ + return @"as-message"; +} + +@end