Reputation: 365
I am a basic developer of Lync 2013 SDK.
I want to change the custom presence status from my application to Lync 2013 client and vice visa.
LyncClient.Self.Contact.ContactInformationChanged
has been added by form load event.
When I change the presence status from my custom application, this will also change the Lync 2013 client's presence status, using my function.
try
{
_lyncClient.Self.BeginPublishContactInformation(
stuffToPublish,
(ar) =>
{
_lyncClient.Self.EndPublishContactInformation(ar);
},
null);
}
catch (ItemNotFoundException)
{
MessageBox.Show(_SelectedCustomAvailabilityId.ToString() + " Item not found");
}
Because the Lync 2013 client's presence status has been changed, the LyncClient.Self.Contact.ContactInformationChanged
event is fired after executing my function.
I don't want this event to occur when the presence status was changed from my application. I want this event to fire only when the presence status has been changed by the Lync 2013 client.
How can I work around this?
Upvotes: 2
Views: 561
Reputation: 959
You won't be able to tell what has caused the presence status change as ultimately the ContactInformationChanged event is really being fired by the Lync server, and not by your client or by your application which simply make request for change.
I would suggest storing what your application thinks the current presence status should be, ie what it has most recently be changed to in the application itself, and testing for that in the event handler.
Upvotes: 1