2

我正在使用 lync 2013 sdk,我需要在通话结束时创建一个带有对话 IM 消息的任务。

我想要一些方法作为 -conversation.getIMmessage()等等。

我该如何实现。

4

1 回答 1

0

因此,假设您使用的是 Lync Client SDK,您将需要将接收到的 IM 的事件处理程序添加到对话中每个参与者的 IM 模态中。最好以相反的顺序考虑:-

为被添加到对话中的参与者设置事件处理程序:-

Conversation.ParticipantAdded += Conversation_ParticipantAdded;

在该事件处理程序中,获取该参与者的 IM 模态,例如:-

var imModality = Conversation.Participants.Single(p => p.Contact.Uri.Equals(newParticipantSIP, StringComparison.CurrentCultureIgnoreCase)).Modalities[ModalityTypes.InstantMessage] as InstantMessageModality;

然后在模态中添加一个 IM 接收事件处理程序:-

imModality.InstantMessageReceived += (sender, e) =>
                {
                    DoStuff(e.Text);
                };
于 2014-08-13T08:47:56.383 回答