fix(eas) improvement for bug #5612 (fixes #5640)

This commit is contained in:
root
2022-11-12 22:37:15 +01:00
parent 7bfa900ae1
commit e1c7e32f84

View File

@@ -40,8 +40,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (NSArray *) allRecipients - (NSArray *) allRecipients
{ {
NGMailAddressParser *parser;
NSEnumerator *addressList;
NSMutableArray *allRecipients; NSMutableArray *allRecipients;
NSArray *recipients; NGMailAddress *address;
NSEnumerator *recipients;
NSString *s;
NSString *fieldNames[] = {@"to", @"cc", @"bcc"}; NSString *fieldNames[] = {@"to", @"cc", @"bcc"};
unsigned int count; unsigned int count;
@@ -49,9 +53,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
for (count = 0; count < 3; count++) for (count = 0; count < 3; count++)
{ {
recipients = [self headersForKey: fieldNames[count]]; recipients = [[self headersForKey: fieldNames[count]] objectEnumerator];
if ([recipients count] > 0) while ((s = [recipients nextObject]))
[allRecipients addObjectsFromArray: recipients]; {
parser = [NGMailAddressParser mailAddressParserWithString: s];
addressList = [[parser parseAddressList] objectEnumerator];
while ((address = [addressList nextObject]))
[allRecipients addObject: [address address]];
}
} }
return allRecipients; return allRecipients;