JSONify mail parts

This commit is contained in:
Francis Lachapelle
2015-05-12 22:37:58 -04:00
parent 6cd02043af
commit 9ed65e34ad
9 changed files with 215 additions and 103 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright (C) 2007-2013 Inverse inc.
Copyright (C) 2007-2015 Inverse inc.
Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of SOGo.
@@ -15,7 +15,7 @@
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
License along with SOGo; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
@@ -31,6 +31,8 @@
#import <NGExtensions/NSString+Encoding.h>
#import <NGExtensions/NSString+misc.h>
#import <NGObjWeb/WOResponse.h>
#import <SOGo/NSString+Utilities.h>
#import <Mailer/NSData+Mail.h>
#import <Mailer/NSDictionary+Mail.h>
@@ -141,6 +143,21 @@
return currentObject;
}
- (id) renderedPart
{
NSString *type;
type = [NSString stringWithFormat: @"%@/%@",
[bodyInfo objectForKey: @"type"],
[bodyInfo objectForKey: @"subtype"]];
return [NSDictionary dictionaryWithObjectsAndKeys:
[self className], @"type",
type, @"contentType",
[[self generateResponse] contentAsString], @"content",
nil];
}
- (NSData *) content
{
return [[self clientObject] fetchBLOB];