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
1=== modified file 'gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py'
2--- gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py 2012-06-07 14:03:13 +0000
3+++ gwibber/microblog/plugins/facebook/gtk/facebook/__init__.py 2012-10-18 15:00:31 +0000
4@@ -105,7 +105,7 @@
5 "redirect_uri": "http://www.facebook.com/connect/login_success.html",
6 })
7 web.load_uri("https://graph.facebook.com/oauth/authorize?" + url)
8- web.connect("title-changed", self.on_facebook_auth_title_change)
9+ web.connect("onload-event", self.on_facebook_auth_title_change)
10
11 self.scroll = Gtk.ScrolledWindow()
12
13@@ -126,7 +126,7 @@
14 self.dialog.infobar_content_area.show()
15
16 url = web.get_main_frame().get_uri()
17- if title.get_title() == "Success":
18+ if "/login_success" in url:
19 try:
20 self.account["access_token"] = str(urlparse.parse_qs(url.split("#", 1)[1])["access_token"][0])
21 except:

Subscribers

People subscribed via source and target branches