From: Andrew Flegg Date: Sat, 12 Dec 2009 22:23:10 +0000 (+0000) Subject: Try to tolerate Facebook violating their own API (i.e. by not X-Git-Tag: 0.2.3~4 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=e2678d4f4c96da03e6c4dd2f77540c1f43224c08;p=hermes Try to tolerate Facebook violating their own API (i.e. by not returning profile_url). Patch provided by Christoph Hrdinka. MB#6768 --- diff --git a/.gitignore b/.gitignore index 5b62e84..2e1f1cb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ hermes_*.changes hermes_*.tar.gz package/build-stamp package/configure-stamp +package/po/*.gmo +package/src/*.pyc +package/debian/files +package/debian/hermes/ *~ diff --git a/package/debian/changelog b/package/debian/changelog index 13db96a..d33f196 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,3 +1,13 @@ +hermes (0.2.3) unstable; urgency=low + + * Include i18n mechanism (requested by Tomasz Dominikowski, provided by + Nicolas Graziano). MB#5834 + * French translations (provided by Nicolas Graziano). MB#5834 + * Try to tolerate Facebook violating their own API (provided by + Christoph Hrdinka). MB#6768 + + -- Andrew Flegg Sat, 12 Dec 2009 20:12:54 +0000 + hermes (0.2.2) unstable; urgency=low * Ignore Twitter's default profile image. MB#5980 (reported by diff --git a/package/src/hermes.py b/package/src/hermes.py index e844113..76329ef 100644 --- a/package/src/hermes.py +++ b/package/src/hermes.py @@ -127,13 +127,18 @@ class Hermes: for friend in self.fb.users.getInfo(self.fb.friends.get(), attrs): key = unicode(friend['name']).encode('trans') self.friends[key] = friend + + if 'profile_url' not in friend: + friend['profile_url'] = "http://www.facebook.com/profile.php?id=" + str(friend ['uid']) + self.friends_by_url[friend['profile_url']] = friend friend['pic'] = friend[attrs[2]] friend['account'] = 'facebook' - if friend['website']: + + if 'website' in friend and friend['website']: friend['homepage'] = friend['website'] - if not friend['pic']: + if 'pic' not in friend or not friend['pic']: self.blocked_pictures.append(friend) @@ -245,10 +250,10 @@ class Hermes: updated = False friend['contact'] = contact - if friend['pic'] and (resync or contact.get_property('photo') is None): + if 'pic' in friend and friend['pic'] and (resync or contact.get_property('photo') is None): updated = self.store.set_photo(contact, friend['pic']) or updated - if friend['birthday_date'] and (resync or contact.get_property('birth-date') is None): + if 'birthday_date' in friend and friend['birthday_date'] and (resync or contact.get_property('birth-date') is None): date_str = friend['birthday_date'].split('/') date_str.append('0') updated = self.store.set_birthday(contact, int(date_str[1]),