Lync ConversationRemoved get current conversation text

强颜欢笑 提交于 2019-12-23 05:44:06

问题


I am using Lync SDK and I am looking if anyone knows how to get the Conversation Text of a conversation that is being closed.

I am running this event.

static void _conversationManager_ConversationRemoved(object sender, Microsoft.Lync.Model.Conversation.ConversationManagerEventArgs e)

And I cannot seam to get any conversation text from this only participants.


回答1:


If you subscribe to the ConversationAdded event of the ConversationManager then you can be notified when each new conversation starts. Within that conversation you can then subscribe to the InstantMessageReceived event of the InstantMessageModality (assuming you want to capture the conversation text of an instant message conversation).

You should then store this somewhere. For instance, you could have a List of conversation IDs, timestamps and messages. I expect you're hoping to get a nicely formatted output such as:

User 1 (10:01) Some text
User 2 (10:02) Some more text

I think you're going to have to produce this yourself, but it should be quite easy. As long as you store (for each message received) the timestamp, the user sending it, the conversation ID to which it pertains, and the text, then you can build it all up later.

In your ConversationRemoved event you can then pull all that data out of the List, format it, and do whatever you want with it.

Hope that helps.

-tom



来源:https://stackoverflow.com/questions/10536331/lync-conversationremoved-get-current-conversation-text

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!