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