aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/jabber/jabber.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2011-12-18 20:25:44 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2011-12-18 20:25:44 +0100
commit18c6d369d777a1d38ef450f868c22de1d0ebba2d (patch)
treed9553b908b2129ab4dd483b2c584be8c27fc15ed /protocols/jabber/jabber.c
parent6e9ae727bcd95eb820fa28becaf9f79ac463de5f (diff)
More generic OAuth support now. Should work well for all GTalk accounts now
and somewhat for MS Messenger. The fb part needs different parsing of the authorize request, and possibly some other work.
Diffstat (limited to 'protocols/jabber/jabber.c')
-rw-r--r--protocols/jabber/jabber.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/protocols/jabber/jabber.c b/protocols/jabber/jabber.c
index 9b94b21d..bf849e2a 100644
--- a/protocols/jabber/jabber.c
+++ b/protocols/jabber/jabber.c
@@ -144,6 +144,13 @@ static void jabber_login( account_t *acc )
{
jd->fd = jd->r_inpa = jd->w_inpa = -1;
+ if( strstr( jd->server, ".live.com" ) )
+ jd->oauth2_service = &oauth2_service_mslive;
+ else if( strstr( jd->server, ".facebook.com" ) )
+ jd->oauth2_service = &oauth2_service_facebook;
+ else
+ jd->oauth2_service = &oauth2_service_google;
+
/* For the first login with OAuth, we have to authenticate via the browser.
For subsequent logins, exchange the refresh token for a valid access
token (even though the last one maybe didn't expire yet). */