aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/rfc822
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-11-13 00:54:48 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2013-11-13 00:54:48 -0800
commitad387cce77cf788fbad2da27c987f78dac4db477 (patch)
treeb48972ce664ef60838cfd118b293923dc829a11d /src/objc/rfc822
parent257a7818f58ee67953e91e381dc3e28a41f14845 (diff)
Fixed #260: added ability to render a message without stripping spaces
Diffstat (limited to 'src/objc/rfc822')
-rw-r--r--src/objc/rfc822/MCOMessageBuilder.h4
-rw-r--r--src/objc/rfc822/MCOMessageBuilder.mm8
-rw-r--r--src/objc/rfc822/MCOMessageParser.h4
-rw-r--r--src/objc/rfc822/MCOMessageParser.mm7
4 files changed, 20 insertions, 3 deletions
diff --git a/src/objc/rfc822/MCOMessageBuilder.h b/src/objc/rfc822/MCOMessageBuilder.h
index 5ba199a4..0ecd2dea 100644
--- a/src/objc/rfc822/MCOMessageBuilder.h
+++ b/src/objc/rfc822/MCOMessageBuilder.h
@@ -71,6 +71,10 @@
This method can be used to generate the summary of the message.*/
- (NSString *) plainTextBodyRendering;
+/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up if requested.
+ This method can be used to generate the summary of the message.*/
+- (NSString *) plainTextBodyRenderingAndStripWhitespace:(BOOL)stripWhitespace;
+
@end
#endif
diff --git a/src/objc/rfc822/MCOMessageBuilder.mm b/src/objc/rfc822/MCOMessageBuilder.mm
index dfcf6028..c884386f 100644
--- a/src/objc/rfc822/MCOMessageBuilder.mm
+++ b/src/objc/rfc822/MCOMessageBuilder.mm
@@ -75,7 +75,6 @@ MCO_OBJC_SYNTHESIZE_STRING(setBoundaryPrefix, boundaryPrefix)
return result;
}
-
- (NSString *) htmlBodyRendering
{
return MCO_OBJC_BRIDGE_GET(htmlBodyRendering);
@@ -88,7 +87,12 @@ MCO_OBJC_SYNTHESIZE_STRING(setBoundaryPrefix, boundaryPrefix)
- (NSString *) plainTextBodyRendering
{
- return MCO_OBJC_BRIDGE_GET(plainTextBodyRendering);
+ return [self plainTextBodyRenderingAndStripWhitespace:YES];
+}
+
+- (NSString *) plainTextBodyRenderingAndStripWhitespace:(BOOL)stripWhitespace
+{
+ return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->plainTextBodyRendering(stripWhitespace));
}
@end
diff --git a/src/objc/rfc822/MCOMessageParser.h b/src/objc/rfc822/MCOMessageParser.h
index 5a009bb7..8a0247be 100644
--- a/src/objc/rfc822/MCOMessageParser.h
+++ b/src/objc/rfc822/MCOMessageParser.h
@@ -48,6 +48,10 @@
This method can be used to generate the summary of the message.*/
- (NSString *) plainTextBodyRendering;
+/** Text rendering of the body of the message. All end of line will be removed and white spaces cleaned up if requested.
+ This method can be used to generate the summary of the message.*/
+- (NSString *) plainTextBodyRenderingAndStripWhitespace:(BOOL)stripWhitespace;
+
@end
#endif
diff --git a/src/objc/rfc822/MCOMessageParser.mm b/src/objc/rfc822/MCOMessageParser.mm
index 8e3f1261..78b84c78 100644
--- a/src/objc/rfc822/MCOMessageParser.mm
+++ b/src/objc/rfc822/MCOMessageParser.mm
@@ -81,7 +81,12 @@
- (NSString *) plainTextBodyRendering
{
- return MCO_OBJC_BRIDGE_GET(plainTextBodyRendering);
+ return [self plainTextBodyRenderingAndStripWhitespace:YES];
+}
+
+- (NSString *) plainTextBodyRenderingAndStripWhitespace:(BOOL)stripWhitespace
+{
+ return MCO_TO_OBJC(MCO_NATIVE_INSTANCE->plainTextBodyRendering(stripWhitespace));
}
@end