mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
Fix for undisposed wrapper.
This commit is contained in:
parent
7773d7f973
commit
12e8f65265
@ -247,17 +247,19 @@ namespace Acacia.UI
|
|||||||
if (_gab?.Contacts != null)
|
if (_gab?.Contacts != null)
|
||||||
{
|
{
|
||||||
// Begin GAB lookup, search on full name or username
|
// Begin GAB lookup, search on full name or username
|
||||||
ISearch<IContactItem> search = _gab.Contacts.Search<IContactItem>();
|
using (ISearch<IContactItem> search = _gab.Contacts.Search<IContactItem>())
|
||||||
|
{
|
||||||
search.AddField("urn:schemas:contacts:customerid").SetOperation(SearchOperation.Equal, username);
|
search.AddField("urn:schemas:contacts:customerid").SetOperation(SearchOperation.Equal, username);
|
||||||
|
|
||||||
// Fetch the result, if any.
|
// Fetch the result, if any.
|
||||||
// TODO: make a SearchOne method?
|
|
||||||
List<GABUser> users = new List<GABUser>();
|
List<GABUser> users = new List<GABUser>();
|
||||||
foreach (IContactItem result in search.Search(1))
|
using (IContactItem result = search.SearchOne())
|
||||||
{
|
{
|
||||||
|
if (result != null)
|
||||||
return new GABUser(result.FullName, result.CustomerID);
|
return new GABUser(result.FullName, result.CustomerID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return new GABUser(username);
|
return new GABUser(username);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user