public void StartNewChatSession(JIDViewModel target)
{
if (connectionState != XmppConnectionState.SessionStarted)
return;
lock (chatSessionsMutext)
{
//Do we already have a chat session open with this target?
ChatSessionViewModel chatSession = chatSessions.SingleOrDefault(x => x.Target == target);
if (chatSession == null)
{
//Create and add.
chatSession = new ChatSessionViewModel(this, target);
chatSessions.Add(chatSession);
}
//Always notify
NotifyChatSessionInitiatedByUser(chatSession);
}
}