No automatic ADD of MSN-buddies
Status: Beta
Brought to you by:
dsj_shock
With hamsam 0.2.3 i've built a messaging bot. New users
should be able to just add the bot to their contacts and
communicate with it. This, however, does not work. The
bot appears offline to new users. Only after i stop the
bot and log in to MSN using the MSN client and the bot's
credentials, i get to authorize all the buddy-add
requests.
I noticed that the IMListeners buddyAddRequest(...)
method is NOT called when an add request is received
(INFO: Server: ADD 0 RL 14 testman@test.net
testman@test.net). That means that no automatic
Response() is returned.
Any tips on how to solve this problem are very welcome.
kind regards,
Bart Breeschoten
The Netherlands
Logged In: YES
user_id=907576
When somebody adds you to their contactlist, you receive a
notification from the server in this form: "ADD 0 RL ppid
nickname".
The MSNServer.run() method checks if there is a transaction
id, which there is, albeit it's value = "0". Then it tries to
retrieve a function name from a callbackMap. This fails as this
is not related to a command that was issued from your client.
The result is that nothing happens.
I've changed the code to treat this situation as an
asynchronous command. In the
NotificationServer.processAsyncCommand() method I added
support for the ADD command, that constructs a Buddy and
invokes EventProcessor.addBuddyRequestReceived(). This in
turn invokes addToBuddyList() on the Protocol, which calls
the buddyAddRequest(0 on the IMListener.