[KOE-17] Small fix to lookup of current user

This commit is contained in:
Patrick Simpson 2017-02-23 17:17:50 +01:00
parent 6daac784c3
commit ce6d62167f
1 changed files with 6 additions and 3 deletions

View File

@ -229,16 +229,19 @@ namespace Acacia.Features.Signatures
// Look for the email address. If found, use the account associated with the GAB // Look for the email address. If found, use the account associated with the GAB
using (ISearch<IContactItem> search = gab.Contacts.Search<IContactItem>()) using (ISearch<IContactItem> search = gab.Contacts.Search<IContactItem>())
{ {
search.AddField("urn:schemas:contacts:email1").SetOperation(SearchOperation.Equal, account.SmtpAddress); search.AddField("urn:schemas:contacts:customerid").SetOperation(SearchOperation.Equal, account.UserName);
IItem result = search.SearchOne(); IItem result = search.SearchOne();
us = result as IContactItem; us = result as IContactItem;
if (result != null && result != us) if (result != null && result != us)
result.Dispose(); result.Dispose();
} }
foreach (string signatureName in signatures) if (us != null)
{ {
ReplacePlaceholders(gab.ActiveAccount, us, signatureName); foreach (string signatureName in signatures)
{
ReplacePlaceholders(gab.ActiveAccount, us, signatureName);
}
} }
} }
catch(Exception e) catch(Exception e)