0

I have an application in which I have subscribed for ConversationAdded and ConversationRemoved.

I want to maintain a list of dictionary of conversation which i received from ConversationAdded event and remove it from the list of once i get the ConversationRemoved Event.

So my question-> Is there some way we can find some uniqueness or some key of Conversation which i can get and add it in the list. And when i get the conversation removed event i can use that key from the conversation object received and remove the conversation object from the list.

Please let me know your comments.

decisive
  • 79
  • 12

2 Answers2

2

Yep, there's a ConversationID you can get. From the ConversationAdded event, you can get it with this:

string ConversationID = e.Conversation.Properties[ConversationProperty.Id].ToString();

More info and a proper walk-through on my blog here.

Tom Morgan
  • 2,355
  • 18
  • 29
  • Hi, The MSDN site for Microsoft Lync says that "Id" or the conversation identifier is not constant and can change throughout the life of the conversation. "[ConversationProperty.Id]" So can we consider it as as unique identifier or the key while storing the conversation. Moreover i have observed that in Conversation_Removed, we get ConversationProperty.Id as null. It happened with me in Lync 2013. http://msdn.microsoft.com/en-us/library/lync/microsoft.lync.model.conversation.conversationproperty_di_3_uc_ocs14mreflyncwpf.aspx – decisive Jan 14 '13 at 15:47
  • Here is a comment from another forum which can be considered as answer – decisive Jan 19 '13 at 05:33
  • i'm aware that the conversationID can change if the conversation is escalated to conference etc. However, in simple 2-person calls, I've not seen the conversation ID change before (but that doesn't really mean anyway). Unfortunately, I'm not aware of a better ID. You could maybe store the sender and receiver of the conversation and use that as a key? I'm not 100% sure if Lync allows multiple conversations between the same people (I don't see why not) – Tom Morgan Jan 22 '13 at 17:16
1

Here is an comment which can be considered as answer

http://social.msdn.microsoft.com/Forums/en-US/communicatorsdk/thread/f174c3fa-f93a-4bd9-a0a2-641510720001

decisive
  • 79
  • 12
  • [Never just post a link](http://meta.stackexchange.com/q/8231/307961). Add a short summary in your answer. – torvin Dec 18 '16 at 23:50