Skip to content
Browse files

Had to change the reference and inReplyTo to use arrays

  • Loading branch information...
1 parent 44d69c9 commit f9581ee61594e35017dbf244ae5f5779e9581b03 @mronge mronge committed
Showing with 22 additions and 32 deletions.
  1. +10 −10 Source/CTCoreMessage.h
  2. +12 −22 Source/CTCoreMessage.m
View
20 Source/CTCoreMessage.h
@@ -258,26 +258,26 @@ The local timezone is the one set in the device running this code
- (void)setTo:(NSSet *)addresses;
/**
-Return the list of messageIds from the in-reply-to field
- */
-- (NSSet *)inReplyTo;
+ Return the list of messageIds from the in-reply-to field
+*/
+- (NSArray *)inReplyTo;
/**
Sets the message's in-reply-to messageIds
- @param messageIds A NSSet containing NSString messageId's
+ @param messageIds A NSArray containing NSString messageId's
*/
-- (void)setInReplyTo:(NSSet *)messageIds;
+- (void)setInReplyTo:(NSArray *)messageIds;
/**
-Return the list of messageIds from the references field
- */
-- (NSSet *)references;
+ Return the list of messageIds from the references field
+*/
+- (NSArray *)references;
/**
Sets the message's references
- @param messageIds A NSSet containing NSString messageId's
+ @param messageIds A NSArray containing NSString messageId's
*/
-- (void)setReferences:(NSSet *)messageIds;
+- (void)setReferences:(NSArray *)messageIds;
/**
Returns the list of people the message was cced to, returns an NSSet containing CTAddress's.
View
34 Source/CTCoreMessage.m
@@ -43,16 +43,6 @@
#import "CTMIME_HtmlPart.h"
#import "MailCoreUtilities.h"
-@interface CTCoreMessage ()
-- (CTCoreAddress *)_addressFromMailbox:(struct mailimf_mailbox *)mailbox;
-- (NSSet *)_addressListFromMailboxList:(struct mailimf_mailbox_list *)mailboxList;
-- (struct mailimf_mailbox_list *)_mailboxListFromAddressList:(NSSet *)addresses;
-- (NSSet *)_addressListFromIMFAddressList:(struct mailimf_address_list *)imfList;
-- (struct mailimf_address_list *)_IMFAddressListFromAddresssList:(NSSet *)addresses;
-- (void)_buildUpBodyText:(CTMIME *)mime result:(NSMutableString *)result;
-- (void)_buildUpHtmlBodyText:(CTMIME *)mime result:(NSMutableString *)result;
-@end
-
@implementation CTCoreMessage
@synthesize mime=myParsedMIME, lastError, parentFolder;
@@ -505,16 +495,16 @@ - (void)setTo:(NSSet *)addresses {
myFields->fld_to = mailimf_to_new(imf);
}
-- (NSSet *)inReplyTo {
+- (NSArray *)inReplyTo {
if (myFields->fld_in_reply_to == NULL)
return nil;
else
- return [self _stringSetFromClist:myFields->fld_in_reply_to->mid_list];
+ return [self _stringArrayFromClist:myFields->fld_in_reply_to->mid_list];
}
-- (void)setInReplyTo:(NSSet *)messageIds {
- struct mailimf_in_reply_to *imf = mailimf_in_reply_to_new([self _clistFromStringSet:messageIds]);
+- (void)setInReplyTo:(NSArray *)messageIds {
+ struct mailimf_in_reply_to *imf = mailimf_in_reply_to_new([self _clistFromStringArray:messageIds]);
if (myFields->fld_in_reply_to != NULL) {
mailimf_in_reply_to_free(myFields->fld_in_reply_to);
@@ -525,16 +515,16 @@ - (void)setInReplyTo:(NSSet *)messageIds {
}
-- (NSSet *)references {
+- (NSArray *)references {
if (myFields->fld_references == NULL)
return nil;
else
- return [self _stringSetFromClist:myFields->fld_references->mid_list];
+ return [self _stringArrayFromClist:myFields->fld_references->mid_list];
}
-- (void)setReferences:(NSSet *)messageIds {
- struct mailimf_references *imf = mailimf_references_new([self _clistFromStringSet:messageIds]);
+- (void)setReferences:(NSArray *)messageIds {
+ struct mailimf_references *imf = mailimf_references_new([self _clistFromStringArray:messageIds]);
if (myFields->fld_references != NULL) {
mailimf_references_free(myFields->fld_references);
@@ -792,9 +782,9 @@ - (struct mailimf_address_list *)_IMFAddressListFromAddresssList:(NSSet *)addres
return imfList;
}
-- (NSSet *)_stringSetFromClist:(clist *)list {
+- (NSArray *)_stringArrayFromClist:(clist *)list {
clistiter *iter;
- NSMutableSet *stringSet = [NSMutableSet set];
+ NSMutableArray *stringSet = [NSMutableArray array];
char *string;
if(list == NULL)
@@ -808,10 +798,10 @@ - (NSSet *)_stringSetFromClist:(clist *)list {
return stringSet;
}
-- (clist *)_clistFromStringSet:(NSSet *)strings {
+- (clist *)_clistFromStringArray:(NSArray *)strings {
clist * str_list = clist_new();
- for (NSString *str in [strings allObjects]) {
+ for (NSString *str in strings) {
clist_append(str_list, strdup([str UTF8String]));
}

0 comments on commit f9581ee

Please sign in to comment.
Something went wrong with that request. Please try again.