views:

161

answers:

1

Dear Stackoverflow, I'm having the following problem:

I'm programming a bot for MSN Messenger in python with the pymsn/papyon library. I have everything running, except that I don't know how to accept new contacts already pending or new requests. Sadly the documentation of the library is very bad. I've achieved to retrieve all pending contacts in the contact list.

My precise question is:
- Is there a handler that accept incoming requests (new and old) and how can I implement it.
or
- If I have the email of the pending contact, what is the function to accept the request or how can I change the membership from Pending to Allow.

I appreciate all your help and/or all the information you can provide.

A: 

Hi, if you want check there is any contact, just list all you contact and check if the contact status is pending. Short code like:

for contact in self.client._address_book.contacts:
    if contact.is_pending:
        self.client._address_book.accept_contact_invitation(contact)

is_pending is my implement but you are easily to write it your own. And you just have a thread monitor this all will be fine.

David Guan