Merge lp:~ken-vandine/gwibber/lp_1058672 into lp:gwibber/3.4

Proposed by Ken VanDine
Status: Needs review
Proposed branch: lp:~ken-vandine/gwibber/lp_1058672
Merge into: lp:gwibber/3.4
Diff against target: 21 lines (+2/-2)
1 file modified
gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py (+2/-2)
To merge this branch: bzr merge lp:~ken-vandine/gwibber/lp_1058672
Reviewer Review Type Date Requested Status
Michael Terry (community) Approve
Review via email: mp+130377@code.launchpad.net

Description of the change

Use webkit's onload-event instead of title changed to detect successful facebook login. Facebook changed the login_success.html file from html to plain text which does not have a title set. (LP: #1058672)

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Makes sense. The if "/login_success" in url bit makes me slightly nervous about false positives. It seems unlikely that /login_success would appear randomly, but... I dunno. /login_success?success=false maybe?

You know facebook's login better than me. If that's a bogus concern, go ahead. Else, approved with that fixed if it is a real concern.

review: Approve

Unmerged revisions

1321. By Ken VanDine

Use webkit's onload-event instead of title changed to
detect successful facebook login. Facebook changed
the login_success.html file from html to plain text
which does not have a title set. (LP: #1058672)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py'
--- gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py 2012-06-07 14:03:13 +0000
+++ gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py 2012-10-18 15:00:31 +0000
@@ -105,7 +105,7 @@
105 "redirect_uri": "http://www.facebook.com/connect/login_success.html",105 "redirect_uri": "http://www.facebook.com/connect/login_success.html",
106 })106 })
107 web.load_uri("https://graph.facebook.com/oauth/authorize?" + url)107 web.load_uri("https://graph.facebook.com/oauth/authorize?" + url)
108 web.connect("title-changed", self.on_facebook_auth_title_change)108 web.connect("onload-event", self.on_facebook_auth_title_change)
109109
110 self.scroll = Gtk.ScrolledWindow()110 self.scroll = Gtk.ScrolledWindow()
111 111
@@ -126,7 +126,7 @@
126 self.dialog.infobar_content_area.show()126 self.dialog.infobar_content_area.show()
127127
128 url = web.get_main_frame().get_uri()128 url = web.get_main_frame().get_uri()
129 if title.get_title() == "Success":129 if "/login_success" in url:
130 try:130 try:
131 self.account["access_token"] = str(urlparse.parse_qs(url.split("#", 1)[1])["access_token"][0])131 self.account["access_token"] = str(urlparse.parse_qs(url.split("#", 1)[1])["access_token"][0])
132 except:132 except:

Subscribers

People subscribed via source and target branches