From cad5d402018c30c4902bc4c74f7bc21f247988e6 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 26 Nov 2007 01:28:40 +0000 Subject: [PATCH] see changelog Monotone-Parent: 06aa9d65ffbfa422bd62686e09571834da68af2f Monotone-Revision: d1e3f0a9a3c943496e50635a2761fd74560c93c1 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2007-11-26T01:28:40 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/Mailer/SOGoDraftObject.m | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3d042ce07..a227c4e46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,12 @@ Modified -flatContentAsString to use UTF-8 as the default fallback encoding for 8-bit content. + * SoObjects/Mailer/SOGoDraftObject.m + Modified _fillInReplyAddresses:replyToAll:envelope: + so that if there's no recipient, we add at least + ourself to the list. + Fixed a mem leak in the same method. + 2007-11-22 Wolfgang Sourdeau * UI/MailPartViewers/UIxMailRenderingContext.m diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index f56c1be80..0a65e754b 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -488,7 +488,19 @@ static BOOL showTextAttachmentsInline = NO; [to release]; } + /* If "to" is empty, we add at least ourself as a recipient! */ + if (![to count]) + { + [to removeAllObjects]; + + if ([[_envelope replyTo] count]) + [self _addEMailsOfAddresses: [_envelope replyTo] toArray: to]; + else + [self _addEMailsOfAddresses: [_envelope from] toArray: to]; + } + [allRecipients release]; + [addrs release]; } - (NSArray *) _attachmentBodiesFromPaths: (NSArray *) paths