I am trying to create a messaging app using Lync 2013 sdk in UI suppression mode, i am using the following code to send message to all participants in the conversation, but i can't find a way to send a message to specific one of them, do anyone know how to do this?
My Code:
public void StartIMConversation(string participantUri)
{
_Conversation.PropertyChanged += _Conversation_PropertyChanged;
_Conversation = _LyncClient.ConversationManager.AddConversation();
}
void ConversationsManager_ConversationAdded(Object source, ConversationManagerEventArgs data)
{
data.Conversation.ParticipantAdded += Conversation_ParticipantAdded;
data.Conversation.StateChanged += Conversation_StateChanged;
data.Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(this.myRemoteParticipantUri));
data.Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(this.myRemoteParticipantUri2));
data.Conversation.AddParticipant(_LyncClient.ContactManager.GetContactByUri(this.myRemoteParticipantUri3));
InstantMessageModality imModality = (InstantMessageModality)participant.Conversation.Modalities[ModalityTypes.InstantMessage];
imModality.BeginSendMessage(message, SendMessageCallback, imModality);
}
private void SendMessageCallback(IAsyncResult ar)
{
InstantMessageModality imModality = (InstantMessageModality)ar.AsyncState;
try
{
imModality.EndSendMessage(ar);
}
catch (LyncClientException lce)
{
MessageBox.Show("Lync Client Exception on EndSendMessage " + lce.Message);
}
}
if this can't be done using the conversation please guide me to the right way, any help appreciated.