Try to tolerate Facebook violating their own API (i.e. by not
authorAndrew Flegg <andrew@bleb.org>
Sat, 12 Dec 2009 22:23:10 +0000 (22:23 +0000)
committerAndrew Flegg <andrew@bleb.org>
Sat, 12 Dec 2009 22:23:10 +0000 (22:23 +0000)
returning profile_url). Patch provided by Christoph Hrdinka. MB#6768

.gitignore
package/debian/changelog
package/src/hermes.py

index 5b62e84..2e1f1cb 100644 (file)
@@ -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/
 *~
index 13db96a..d33f196 100644 (file)
@@ -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 <andrew@bleb.org>  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
index e844113..76329ef 100644 (file)
@@ -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]),