2006-06-15 21:34:10 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2004-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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
UIxMailPartTextViewer
|
|
|
|
|
2006-09-19 23:09:11 +02:00
|
|
|
Show plaintext mail parts correctly formatted.
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
TODO: add server side wrapping.
|
|
|
|
TODO: add contained link detection.
|
|
|
|
*/
|
|
|
|
|
2007-07-30 16:12:21 +02:00
|
|
|
#import <NGExtensions/NSString+misc.h>
|
2007-05-15 22:52:38 +02:00
|
|
|
|
2007-07-30 16:12:21 +02:00
|
|
|
#import <SoObjects/SOGo/NSString+Utilities.h>
|
2006-06-15 21:34:10 +02:00
|
|
|
|
2006-09-19 23:09:11 +02:00
|
|
|
#import "UIxMailPartTextViewer.h"
|
2006-06-15 21:34:10 +02:00
|
|
|
|
|
|
|
@implementation UIxMailPartTextViewer
|
|
|
|
|
2006-09-19 23:06:59 +02:00
|
|
|
- (NSString *) flatContentAsString
|
2006-09-19 23:06:47 +02:00
|
|
|
{
|
2007-05-15 22:52:38 +02:00
|
|
|
NSMutableString *content;
|
2007-05-22 20:41:02 +02:00
|
|
|
NSString *superContent;
|
2007-05-15 22:52:38 +02:00
|
|
|
|
|
|
|
content = [NSMutableString string];
|
|
|
|
superContent = [[super flatContentAsString] stringByEscapingHTMLString];
|
|
|
|
[content appendString: [superContent stringByDetectingURLs]];
|
|
|
|
[content replaceString: @"\r\n" withString: @"<br />"];
|
|
|
|
[content replaceString: @"\n" withString: @"<br />"];
|
|
|
|
|
|
|
|
return content;
|
2006-09-19 23:06:47 +02:00
|
|
|
}
|
|
|
|
|
2006-06-15 21:34:10 +02:00
|
|
|
@end /* UIxMailPartTextViewer */
|