I tested this with the example application,it works well.
When i want to send message on my own initiative like the follow codes
<code>
MsnMessenger messenger = MsnMessengerFactory.createMsnMessenger(email,
password);
……
messenger.login();
……
messenger.sendText(Email.parseStr("xxx@xxx.xxx"),"xxx");
</code>
problem comes,it doesn't work.
So,i can only send message in the Listeners' event?
How can i send message on my own initiative?
Wish help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It may just be a typo, but what is:
messenger.sendText(Email.parseStr("xxx@xxx.xxx"),"xxx";);
The extra ; in this statement? (after "xxx") Granted, I'm not sure if that will even cause a problem, but still. =)
Assuming you did indeed log on, I don't really see why this would not have worked for you. =/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm able to use sendText() when a switchboard session already exists for the contact (started by talking to the client). However, when I try to use sendText() to a contact that does not have an existing switchboard session, nothing happens (or, at least, the corresponding switchboardListener never gets triggered). Any ideas on how I would go about getting to the bottom of this? (yes, the client has definitely logged in when the sendText() get's called).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tested this with the example application,it works well.
When i want to send message on my own initiative like the follow codes
<code>
MsnMessenger messenger = MsnMessengerFactory.createMsnMessenger(email,
password);
……
messenger.login();
……
messenger.sendText(Email.parseStr("xxx@xxx.xxx"),"xxx");
</code>
problem comes,it doesn't work.
So,i can only send message in the Listeners' event?
How can i send message on my own initiative?
Wish help!
It may just be a typo, but what is:
messenger.sendText(Email.parseStr("xxx@xxx.xxx"),"xxx";);
The extra ; in this statement? (after "xxx") Granted, I'm not sure if that will even cause a problem, but still. =)
Assuming you did indeed log on, I don't really see why this would not have worked for you. =/
Take a look at this:
https://sourceforge.net/forum/forum.php?thread_id=1484158&forum_id=405892
I think this explains the problem you are having. (ie, you may be sending the message before MSN is ready for you)
I know the reason.
It didn't work because the MSN msessenger had not finished login.
Thanks very much.
Similar symptoms but a different problem here.
I'm able to use sendText() when a switchboard session already exists for the contact (started by talking to the client). However, when I try to use sendText() to a contact that does not have an existing switchboard session, nothing happens (or, at least, the corresponding switchboardListener never gets triggered). Any ideas on how I would go about getting to the bottom of this? (yes, the client has definitely logged in when the sendText() get's called).
Here's the log:
<code>
>> send qmanic@hotmail.com hey
4/11/2006 21:29:22 net.sf.jml.protocol.MsnSession$1 messageSent
INFO: xjbot2@hotmail.com NS >>> XFR 8 SB
>> 4/11/2006 21:29:23 net.sf.jml.protocol.MsnSession$1 messageReceived
INFO: xjbot2@hotmail.com NS <<< XFR 8 SB 64.4.36.15:1863 CKI 1387924056.105132164.10226215
4/11/2006 21:29:23 net.sf.jml.protocol.MsnSession$1 messageSent
INFO: xjbot2@hotmail.com SB >>> USR 1 xjbot2@hotmail.com 1387924056.105132164.10226215
4/11/2006 21:29:23 net.sf.jml.protocol.MsnSession$1 messageReceived
INFO: xjbot2@hotmail.com SB <<< USR 1 OK xjbot2@hotmail.com xJBot
</code>
Nevermind, got it - contact wasn't in the FL <_>