Menu

Auto accept of friend invitation

Alex Art
2009-08-25
2013-04-29
  • Alex Art

    Alex Art - 2009-08-25

    I'm developing bot , which should accept all users and add them to its buddy list , I have implemented listener, which catch contactAddedMe(..) message..

    I'm doing something like this to accept invitation

    public void contactAddedMe(MsnMessenger msnMessenger, MsnContact msnContact) {
                msnMessenger.addFriend(msnContact.getEmail(), msnContact.getFriendlyName());
    }

    It works fine first time(MSN user adds bot and bot is online), but if MSN user removes bot and adds again he will see my bot online until bot restarted.  In this case I still have call of  contactAddedMe() message but  msnMessenger.addFriend(..) has no effect and bot appear to be online ..

     
    • luo dongri

      luo dongri - 2009-08-26

      I want to know ,too.

       
  • Alex Mason

    Alex Mason - 2010-03-02

    it was hard to find at first but here you go:
        public void contactAddedMe(MsnMessenger mm, MsnContact mc) {
            log.info("User added: "+Email.parseStr(mc.getId()) +":"+ mc.getFriendlyName());
            mm.addFriend(Email.parseStr(mc.getId()), mc.getFriendlyName());
        }

     

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.