msnp, friends list

J

jr

I'm currently using the msnp.py code from Manish Jethani's project. I
havn't been able to get the friends list to update like it should. it
works once out of about every 25 times the program loads.

Has anyone been able to implement his code and get the friends list to
actively update? Or have any suggestions?

Any info would be great.
Thanks.
 
M

Mark Rowe

I'm currently using the msnp.py code from Manish Jethani's project. I
havn't been able to get the friends list to update like it should. it
works once out of about every 25 times the program loads.

Has anyone been able to implement his code and get the friends list to
actively update? Or have any suggestions?

I just spent a few minutes experimenting, and it seems that the
following code does what you would like:

import msnp
import time

class MsnListener(msnp.SessionCallbacks):
def friend_list_updated(self, friend_list):
print 'Got friend list update:', friend_list.lists

msn = msnp.Session(MsnListener())
msn.login('(e-mail address removed)', 'xxxxxxx')
msn.sync_friend_list()

while True:
msn.process()
time.sleep(1)
Any info would be great.
Thanks.

Hope this helps,

Mark Rowe
<http://bdash.net.nz/>
 
J

jr

Sorry, I guess what I meant to ask was the status of the friends in the
friends list begin updated. Right now we have a friends list which is
being populated with the correct users, but their status (online,
offline) is never getting set. For some reason the events aren't being
fired??
 
M

Mark Rowe

Sorry, I guess what I meant to ask was the status of the friends in the
friends list begin updated. Right now we have a friends list which is
being populated with the correct users, but their status (online,
offline) is never getting set. For some reason the events aren't being
fired??

Ok, I've seen this problem before. Basically, the MSN servers do not
send state changes for your buddies if you change your status from
offline -> online before you have retrieved your entire buddy list.
There doesn't appear to be a way around that with msnp as it always
changes your state after sign-in, and it fails to group the buddy list
state into a single transaction so that you can tell when the entire
list has been retrieved... It should be relatively simple to adapt the
code to fix the problem.

Regards,

Mark Rowe
<http://bdash.net.nz/>
 
J

jr

Mark,
Thank you so much for that information. Been struggling with this issue
for quite some time now. A simle line comment on line 647 of session.py
solves all problems :)
this line sets your status to online and does not get time (usually) to
get friends list correctly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,219
Messages
2,571,127
Members
47,744
Latest member
FrederickM

Latest Threads

Top