Menu

How to send message on my own initiative

Help
kenney
2006-08-24
2013-04-29
  • kenney

    kenney - 2006-08-24

    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!

     
    • Daniel Henninger

      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.  =/

       
    • Daniel Henninger

      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)

       
      • kenney

        kenney - 2006-09-18

          I know the reason.
          It didn't work because the MSN msessenger had not finished login.
          Thanks very much.

         
    • qmanic

      qmanic - 2006-11-04

      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).

       
      • qmanic

        qmanic - 2006-11-04

        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>

         
    • qmanic

      qmanic - 2006-11-04

      Nevermind, got it - contact wasn't in the FL <_>

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.