Closed GoogleCodeExporter closed 8 years ago
Hello,
The idea behind MSNPSharp's degin is event driven, message oriented model. If
you insist to let it work in a procedure oriented way, you will run into a lot
of difficulties. Please separate the procedure of initializing your Messenger
object and sending IM. You should always using the same Messenger object to
communicate with others instead of create one and login every time the SendIm()
was called.
Your null switchboad problem is, at the time you want to send a message, the
remote user has not yet connected to the switchboard. And one more, the example
client for 3.1 does not use Conversation and switchboard to send message
anymore (Although they are still supported if you use them properly), you can
send a message with following code:
TextMessage message = new TextMessage("Hello");
ConversationID conversationIdentifier = Messenger.MessageManager.GetID(contact);
conversationIdentifier =
Messenger.MessageManager.SendTextMessage(ConversationID, message);
Please read the example client again, especially for ConversationForm.cs, I
think that's all you want.
Thank you.
Original comment by freezing...@gmail.com
on 7 Oct 2010 at 1:45
Sorry, there's some typo in my last post, the code should be:
TextMessage message = new TextMessage("Hello");
ConversationID conversationIdentifier = Messenger.MessageManager.GetID(contact);
conversationIdentifier =
Messenger.MessageManager.SendTextMessage(conversationIdentifier, message);
The contact is and Contact object, get from your contact list.
Original comment by freezing...@gmail.com
on 7 Oct 2010 at 1:47
Thank you for the direction, it helped a lot. I switched to the 3.1 syntax and
it talked to me a lot more.
My proper application is actually event driven, this example was really an
attempt to understand why my switchboard wasn't instantiated properly.
So to conclude, thanks a lot problem solved.
Everything works smoothly now. You really do a great job with msnp-sharp.
Original comment by Harme...@gmail.com
on 7 Oct 2010 at 8:46
You are welcome, and one more suggestion: I recommend you check out our code
from the trunk of SVN repository, because we get some bug fixed there, but not
yet release for downloading.
Original comment by freezing...@gmail.com
on 8 Oct 2010 at 1:51
Original issue reported on code.google.com by
Harme...@gmail.com
on 6 Oct 2010 at 7:40