aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hoa V. Dinh <dinh.viet.hoa@gmail.com>2014-02-26 10:34:57 -0800
committerGravatar Hoa V. Dinh <dinh.viet.hoa@gmail.com>2014-02-26 10:34:57 -0800
commit8d47641a47546e7e11cc20bace61053f9289e36b (patch)
tree00d69d2039922f041bff61ffe4e2917db84b00f4
parent9f76b56e41d2407c7eea2e01ad756b91d23af4a5 (diff)
Fixed #586 again: removed new methods and renamed existing Obj-C methods
-rw-r--r--src/objc/abstract/MCOMessageHeader.h20
-rw-r--r--src/objc/abstract/MCOMessageHeader.mm32
2 files changed, 12 insertions, 40 deletions
diff --git a/src/objc/abstract/MCOMessageHeader.h b/src/objc/abstract/MCOMessageHeader.h
index 7c6527a6..f47e71b6 100644
--- a/src/objc/abstract/MCOMessageHeader.h
+++ b/src/objc/abstract/MCOMessageHeader.h
@@ -58,16 +58,16 @@
@property (nonatomic, copy) NSString * userAgent;
/** Adds a custom header.*/
-- (void)addHeaderValue:(NSString *)value forName:(NSString *)name;
+- (void) setExtraHeaderValue:(NSString *)value forName:(NSString *)name;
/** Remove a given custom header.*/
-- (void)removeHeaderForName:(NSString *)name;
+- (void) removeExtraHeaderForName:(NSString *)name;
/** Returns the value of a given custom header.*/
-- (NSString *)headerValueForName:(NSString *)name;
+- (NSString *) extraHeaderValueForName:(NSString *)name;
/** Returns an array with the names of all custom headers.*/
-- (NSArray * /* NSString */)allHeadersNames;
+- (NSArray * /* NSString */) allExtraHeadersNames;
/** Extracted subject (also remove square brackets).*/
- (NSString *) extractedSubject;
@@ -87,18 +87,6 @@
/** Returns a header that can be used as a base for a forward message.*/
- (MCOMessageHeader *) forwardHeader;
-/** Set a custom header. */
-- (void) setExtraHeader:(NSString *)name value:(NSString *)value;
-
-/** Remove a custom header. */
-- (void) removeExtraHeader:(NSString *)name;
-
-/** Returns the value of a custom header. */
-- (NSString *) extraHeaderValueForName:(NSString *)name;
-
-/** Returns the names of the custom headers. */
-- (NSArray *) allExtraHeadersNames;
-
@end
#endif
diff --git a/src/objc/abstract/MCOMessageHeader.mm b/src/objc/abstract/MCOMessageHeader.mm
index 708eaed2..f2266b79 100644
--- a/src/objc/abstract/MCOMessageHeader.mm
+++ b/src/objc/abstract/MCOMessageHeader.mm
@@ -102,18 +102,22 @@ MCO_OBJC_SYNTHESIZE_ARRAY(setReplyTo, replyTo)
MCO_OBJC_SYNTHESIZE_STRING(setSubject, subject)
MCO_OBJC_SYNTHESIZE_STRING(setUserAgent, userAgent)
-- (void)addHeaderValue:(NSString *)value forName:(NSString *)name {
+- (void) setExtraHeaderValue:(NSString *)value forName:(NSString *)name
+{
_nativeHeader->setExtraHeader(MCO_FROM_OBJC(mailcore::String, name), MCO_FROM_OBJC(mailcore::String, value));
}
-- (NSString *)headerValueForName:(NSString *)name {
+- (NSString *) extraHeaderValueForName:(NSString *)name
+{
return MCO_TO_OBJC(_nativeHeader->extraHeaderValueForName((MCO_FROM_OBJC(mailcore::String, name))));
}
-- (void)removeHeaderForName:(NSString *)name {
+- (void) removeExtraHeaderForName:(NSString *)name
+{
_nativeHeader->removeExtraHeader(MCO_FROM_OBJC(mailcore::String, name));
}
-- (NSArray * /* NSString */)allHeadersNames {
+- (NSArray * /* NSString */) allExtraHeadersNames
+{
return MCO_TO_OBJC(_nativeHeader->allExtraHeadersNames());
}
@@ -147,24 +151,4 @@ MCO_OBJC_SYNTHESIZE_STRING(setUserAgent, userAgent)
return MCO_TO_OBJC(_nativeHeader->forwardHeader());
}
-- (void) setExtraHeader:(NSString *)name value:(NSString *)value
-{
- _nativeHeader->setExtraHeader(MCO_FROM_OBJC(mailcore::String, name), MCO_FROM_OBJC(mailcore::String, value));
-}
-
-- (void) removeExtraHeader:(NSString *)name
-{
- _nativeHeader->removeExtraHeader(MCO_FROM_OBJC(mailcore::String, name));
-}
-
-- (NSString *) extraHeaderValueForName:(NSString *)name
-{
- return MCO_TO_OBJC(_nativeHeader->extraHeaderValueForName(MCO_FROM_OBJC(mailcore::String, name)));
-}
-
-- (NSArray *) allExtraHeadersNames
-{
- return MCO_TO_OBJC(_nativeHeader->allExtraHeadersNames());
-}
-
@end