Cleaned up messy logic in pwn
authorTobias Mueller <tobiasmue@gnome.org>
Thu, 13 Jan 2011 17:42:32 +0000 (18:42 +0100)
committerTobias Mueller <tobiasmue@gnome.org>
Thu, 13 Jan 2011 17:42:32 +0000 (18:42 +0100)
I think I understood what was going on and that the new logic is equivalent.

pwnitter.py

index e8404c2..5a06ed2 100755 (executable)
@@ -160,8 +160,8 @@ class Pwnitter(dbus.service.Object):
 
 
                         # We don't want to repeatedly spam people
 
 
                         # We don't want to repeatedly spam people
-                        # FIXME: What the fuck logic. Please clean up
-                        if not ((not name and host != 'mobile.twitter.com') or name in processed):
+                        # Also proceed if we didn't find a name but are on the mobile page
+                        if  not (name in processed)   or   ((not name) and host == 'mobile.twitter.com'):
                             headers = {
                                 "User-Agent": "Mozilla/5.0",
                                 "Accept": "application/json, text/javascript, */*",
                             headers = {
                                 "User-Agent": "Mozilla/5.0",
                                 "Accept": "application/json, text/javascript, */*",