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 ..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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());
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 ..
I want to know ,too.
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());
}