Send IM message to specific user in the conversation Lync 2013 SDK in UI suppression mode

StackOverflow https://stackoverflow.com/questions/22229554

  •  06-06-2023
  •  | 
  •  

Domanda

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.

È stato utile?

Soluzione

There isn't a way to be selective of the recipients of an IM in a given conversation. Your best bet is probably to start a separate conversation with just the participants you need.

Altri suggerimenti

I agree with the selected answer ... but ... as you're writing a UI Suppression App, you can use a separate IM conversation (as per the answer) but then present it inline. As you're controlling the display of the conference, you can display it however you want, if that's really what you want to do.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top