somebody tried to handle multiple conversation ? can someone to provide an example of how to do it ?
i tried in this way:
void Conversation_ContactJoined(object sender, ContactEventArgs e)
{
//The request is initiated by remote user, so we needn't invite anyone
Conversation convers = sender as Conversation;
Console.WriteLine("Contact Joined to Conversation: " + e.Contact.Name);
try
{
Talk = convers;
convers.AutoKeepAlive = true;
convers.ConversationEnded += new EventHandler<ConversationEndEventArgs>(convers_ConversationEnded);
convers.ContactLeft += new EventHandler<ContactEventArgs>(convers_ContactLeft);
//convers.TextMessageReceived += new EventHandler<ConversationCreatedEventArgs>(messenger_ConversationCreated);
convers.TextMessageReceived += new EventHandler<TextMessageEventArgs>(ConversationReplay);
convers.SendTextMessage(new TextMessage("Conversation_ContactJoined event :)" + e.Contact.Name));
}
catch (Exception err) { Console.WriteLine("Contact Joined Error: " + err.Message.ToString()); }
}
and here i receive all user messages:
private void ConversationReplay(object sender, TextMessageEventArgs e)
{
Console.WriteLine(e.Sender.Name + ":" + e.Message.Text.ToString());
//Talk.SendNudge();
try
{
Talk.SendTypingMessage();
//System.Threading.Thread.Sleep(3000);
Talk.SendTextMessage(new TextMessage("Hey this is an reply to your [" + e.Message.Text.ToString() + "] :P"));
}
catch (Exception err) { Console.WriteLine("Reply Error: " + err.Message.ToString());}
}
but i have one problem :) i can reply only to last user that is joined to this conversation :) if someone already fixed this problem using MSNP-SHARP library please give a hint :)
thanks.