gpt4 book ai didi

c# - 如何从 lync 客户端 2013 通信中检索 IM 消息

转载 作者:太空宇宙 更新时间:2023-11-03 15:52:21 24 4
gpt4 key购买 nike

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

我想要一些方法,如 - conversation.getIMmessage()

我该如何实现。

最佳答案

因此,假设您使用的是 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);
};

关于c# - 如何从 lync 客户端 2013 通信中检索 IM 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25263573/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com