468,765 Members | 1,138 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

msnp, friends list

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.

Jul 18 '05 #1
4 2191

On Feb 18, 2005, at 7:31 AM, jr wrote:
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('x*******@xxxx.com', '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/>

Jul 18 '05 #2
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??

Jul 18 '05 #3

On Feb 18, 2005, at 11:35 AM, jr wrote:
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/>

Jul 18 '05 #4
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.

Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by sparda713 | last post: by
5 posts views Thread by Darryl B | last post: by
6 posts views Thread by hardik | last post: by
1 post views Thread by codergem | last post: by
22 posts views Thread by joshc | last post: by
15 posts views Thread by getsanjay.sharma | last post: by
3 posts views Thread by Michiel Overtoom | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.