Skip to content

Commit

Permalink
[CORE] request dp each time a contact changes its status (but msn_obj…
Browse files Browse the repository at this point in the history
…ect is None the 1st time we know that the contact is online)
  • Loading branch information
Boris Faure committed Nov 3, 2008
1 parent 0b010c2 commit e823029
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions amsn2/core/contactlist_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ def onContactPresenceChanged(self, pymsn_contact):

#TODO: update the group view

#Request the DP...
if (pymsn_contact.presence is not pymsn.Presence.OFFLINE and
pymsn_contact.msn_object):
self._core._profile.client._msn_object_store.request(pymsn_contact.msn_object,
(self.onDPdownloaded,
pymsn_contact.id))

def onCLDownloaded(self, address_book):
self._pymsn_addressbook = address_book
Expand Down Expand Up @@ -95,18 +101,6 @@ def onCLDownloaded(self, address_book):
for c in cviews:
self.emit(self.CONTACTVIEW_UPDATED, c)

#self._core._loop.timer_add(3, self.request_all_display_picture)
self.request_all_display_picture()

def request_all_display_picture(self):
contacts = self._pymsn_addressbook.contacts.\
search_by_presence(pymsn.Presence.OFFLINE)
contacts = self._pymsn_addressbook.contacts - contacts
for c in contacts:
if c.msn_object:
self._core._profile.client._msn_object_store.request(c.msn_object,
(self.onDPdownloaded, c.id))

def onDPdownloaded(self, msn_object, uid):
#1st/ update the aMSNContact object
c = self.getContact(uid)
Expand Down

0 comments on commit e823029

Please sign in to comment.