id subject; /* can be either NSData or NSString */
NSString *inReplyTo;
NSString *msgId;
- NGImap4EnvelopeAddress *from;
NGImap4EnvelopeAddress *sender;
- NGImap4EnvelopeAddress *replyTo;
+ NSArray *from;
+ NSArray *replyTo;
NSArray *to;
NSArray *cc;
NSArray *bcc;
}
- (id)initWithMessageID:(NSString *)_msgID subject:(NSString *)_subject
- sender:(id)_sender replyTo:(id)_replyTo
+ from:(NSArray *)_sender replyTo:(NSArray *)_replyTo
to:(NSArray *)_to cc:(NSArray *)_cc bcc:(NSArray *)_bcc;
- (id)initWithBodyStructureInfo:(NSDictionary *)_info;
- (id)subject;
- (NSString *)inReplyTo;
- (NSString *)messageID;
-- (NGImap4EnvelopeAddress *)from;
- (NGImap4EnvelopeAddress *)sender;
-- (NGImap4EnvelopeAddress *)replyTo;
+- (NSArray *)from;
+- (NSArray *)replyTo;
- (NSArray *)to;
- (NSArray *)cc;
- (NSArray *)bcc;
}
- (id)initWithMessageID:(NSString *)_msgID subject:(NSString *)_subject
- sender:(id)_sender replyTo:(id)_replyTo
+ from:(NSArray *)_from replyTo:(NSArray *)_replyTo
to:(NSArray *)_to cc:(NSArray *)_cc bcc:(NSArray *)_bcc
{
if ((self = [self init])) {
self->msgId = [_msgID copy];
self->subject = [_subject copy];
- self->from = [self newEnvelopeAddressForEMail:_sender];
- self->replyTo = [self newEnvelopeAddressForEMail:_replyTo];
-
- self->to = [[self envelopeAddressesForEMails:_to] copy];
- self->cc = [[self envelopeAddressesForEMails:_cc] copy];
- self->bcc = [[self envelopeAddressesForEMails:_bcc] copy];
+ self->from = [[self envelopeAddressesForEMails:_from] copy];
+ self->replyTo = [[self envelopeAddressesForEMails:_replyTo] copy];
+ self->to = [[self envelopeAddressesForEMails:_to] copy];
+ self->cc = [[self envelopeAddressesForEMails:_cc] copy];
+ self->bcc = [[self envelopeAddressesForEMails:_bcc] copy];
}
return self;
}
- (id)initWithBodyStructureInfo:(NSDictionary *)_info {
- id lFrom, lReplyTo, lDate;
+ id lDate;
if (![_info isNotNull]) {
[self release];
return nil;
}
-
- lFrom = [_info valueForKey:@"from"];
- lReplyTo = [_info valueForKey:@"reply-to"];
-
- if ([lFrom isKindOfClass:[NSArray class]])
- lFrom = [lFrom count] > 0 ? [lFrom objectAtIndex:0] : nil;
- if ([lReplyTo isKindOfClass:[NSArray class]])
- lReplyTo = [lReplyTo count] > 0 ? [lReplyTo objectAtIndex:0] : nil;
self = [self initWithMessageID:[_info valueForKey:@"messageId"]
subject:[_info valueForKey:@"subject"]
- sender:lFrom replyTo:lReplyTo
+ from:[_info valueForKey:@"from"]
+ replyTo:[_info valueForKey:@"reply-to"]
to:[_info valueForKey:@"to"]
cc:[_info valueForKey:@"cc"]
bcc:[_info valueForKey:@"bcc"]];
- (NSString *)messageID {
return self->msgId;
}
-- (NGImap4EnvelopeAddress *)from {
+- (NSArray *)from {
return self->from;
}
- (NGImap4EnvelopeAddress *)sender {
return self->sender;
}
-- (NGImap4EnvelopeAddress *)replyTo {
+- (NSArray *)replyTo {
return self->replyTo;
}
- (NSArray *)to {
if (self->msgId) [ms appendFormat:@" msgid='%@'", self->msgId];
if (self->inReplyTo) [ms appendFormat:@" inreplyto='%@'", self->inReplyTo];
- if (self->from) [ms appendFormat:@" from=%@", [self->from email]];
- if (self->sender) [ms appendFormat:@" sender=%@", [self->sender email]];
+ if (self->from) [ms appendFormat:@" from=%@", self->from];
+ if (self->replyTo) [ms appendFormat:@" reply-to=%@", self->replyTo];
+ if (self->sender) [ms appendFormat:@" sender=%@", [self->sender email]];
if (self->to) [ms appendFormat:@" to=%@", self->to];
if (self->cc) [ms appendFormat:@" cc=%@", self->cc];