diff --git a/ChangeLog b/ChangeLog index 37b7b4aef..122f478f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-05 Francis Lachapelle + + * SoObjects/Mailer/SOGoDraftObject.m: The condition for replyToAll + has to be done later to avoid duplicated to and cc addresses. + 2007-12-04 Wolfgang Sourdeau * SoObjects/Appointments/SOGoAppointmentFolder.m diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 4aac23ded..fd3ac5312 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -466,27 +466,6 @@ static BOOL showTextAttachmentsInline = NO; [self _addRecipients: addrs toArray: allRecipients]; [_info setObject: to forKey: @"to"]; - /* CC processing if we reply-to-all: add all 'to' and 'cc' */ - if (_replyToAll) - { - to = [NSMutableArray new]; - - [addrs setArray: [_envelope to]]; - [self _purgeRecipients: allRecipients - fromAddresses: addrs]; - [self _addEMailsOfAddresses: addrs toArray: to]; - [self _addRecipients: addrs toArray: allRecipients]; - - [addrs setArray: [_envelope cc]]; - [self _purgeRecipients: allRecipients - fromAddresses: addrs]; - [self _addEMailsOfAddresses: addrs toArray: to]; - - [_info setObject: to forKey: @"cc"]; - - [to release]; - } - /* If "to" is empty, we add at least ourself as a recipient! This is for emails in the "Sent" folder that we reply to... */ if (![to count]) @@ -508,6 +487,27 @@ static BOOL showTextAttachmentsInline = NO; [_info removeObjectForKey: @"cc"]; } + /* CC processing if we reply-to-all: add all 'to' and 'cc' */ + if (_replyToAll) + { + to = [NSMutableArray new]; + + [addrs setArray: [_envelope to]]; + [self _purgeRecipients: allRecipients + fromAddresses: addrs]; + [self _addEMailsOfAddresses: addrs toArray: to]; + [self _addRecipients: addrs toArray: allRecipients]; + + [addrs setArray: [_envelope cc]]; + [self _purgeRecipients: allRecipients + fromAddresses: addrs]; + [self _addEMailsOfAddresses: addrs toArray: to]; + + [_info setObject: to forKey: @"cc"]; + + [to release]; + } + [allRecipients release]; [addrs release]; }