Search code examples
c#winformscontactsskype-for-businesslync-client-sdk

Get Multiple Contacts from 1 search in Lync2013 SDK


I have an email address list retrieved from a corporate webservice.
All the addresses are known to exist in Lync/S4B as valid contacts.

I am trying to make an app that shows presence for this list of addresses but I am running into performance problems when the list is large.
In worst case I have about 400 addresses I need to get presence for. Sofar the only way I can successfully convert the addresses into contacts is by firing off 400 ContactManager.BeginSearch() requests (1 for each address) using SearchProviders.GlobalAddressList. I have done lots of searching on the web and cant find any other way to do this. ExpertSearch is not enabled in my case(dont even know if it will help). Its taking about 50 seconds just to get the contacts.

1) Any ideas for faster ways of getting the contacts?
2) Or is it possible to add a contact to a subscriptionlist after Subscriptionlist.Subscribe() is called? If so, does it re-subscribe existing contacts in the subscriptionlist? And do you have to call Subscribe() again after new contact added?


Solution

  • I'm not sure I can answer 1) but I think there is no other faster way available, but I'm sure.

    For question 2), yes you can call AddContact/AddContacts/RemoveContact without having to call Subscribe/Unsubscribe again. Each contact subscription is separate from each other. So adding/removing a contact subscription does not affect the subscription from other contacts.