feat(mail): handle multiple mail identities

Fixes #5087
pull/287/head
Francis Lachapelle 2020-07-30 15:16:28 -04:00
parent 87cf5b473f
commit a8bbaf01d7
1 changed files with 13 additions and 1 deletions

View File

@ -692,7 +692,13 @@ static NSString *userAgent = nil;
if (_fromSentMailbox)
[self _addRecipients: [_envelope from] toArray: addrs];
else
[self _addRecipients: [_envelope to] toArray: addrs];
{
[self _addRecipients: [_envelope to] toArray: addrs];
if ([addrs count] == 0)
[self _addRecipients: [_envelope cc] toArray: addrs];
if ([addrs count] == 0)
[self _addRecipients: [_envelope bcc] toArray: addrs];
}
if ([addrs count])
{
@ -707,6 +713,12 @@ static NSString *userAgent = nil;
[_info setObject: [self _emailFromIdentity: identity] forKey: @"from"];
}
}
else
{
identity = [[context activeUser] defaultIdentity];
if (identity)
[_info setObject: [self _emailFromIdentity: identity] forKey: @"from"];
}
}
//