From ce16996762e414334281811cb6d6af8fae708f00 Mon Sep 17 00:00:00 2001 From: jamesbunton Date: Tue, 1 Nov 2005 00:28:42 +0000 Subject: [PATCH] Ported 7:8 fix of handling MSN users disabling their avatar from branches/0_10_x git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@9 55fbd22a-6204-0410-b2f0-b6c764c7e90a committer: jamesbunton --- src/legacy/glue.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/legacy/glue.py b/src/legacy/glue.py index e155b8b..b93e011 100644 --- a/src/legacy/glue.py +++ b/src/legacy/glue.py @@ -312,16 +312,24 @@ class LegacyConnection(msnw.MSNConnection): def avatarHashChanged(self, userHandle, hash): if not self.session: return - av = self.session.pytrans.avatarCache.getAvatar(hash) - if av: - msnContact = self.getContacts().getContact(userHandle) - msnContact.msnobjGot = True - jid = msn2jid(userHandle) + + if not hash: + # They've turned off their avatar c = self.session.contactList.findContact(jid) if not c: return c.updateAvatar(av) else: - self.requestAvatar(userHandle) + # New avatar + av = self.session.pytrans.avatarCache.getAvatar(hash) + if av: + msnContact = self.getContacts().getContact(userHandle) + msnContact.msnobjGot = True + jid = msn2jid(userHandle) + c = self.session.contactList.findContact(jid) + if not c: return + c.updateAvatar(av) + else: + self.requestAvatar(userHandle) def gotAvatarImage(self, userHandle, imageData): if not self.session: return -- 2.39.2