diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-03 07:09:43 +0200 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2012-09-03 07:09:43 +0200 |
| commit | 59466bbc70b5b51f35458bddac6e7df4203c42b7 (patch) | |
| tree | f9b5b3ec191a8e9beee670469b13e80f6ec24723 /src/client | |
| parent | 2e95b3d002ef4bc50a239f21118165d3c6bd1f72 (diff) | |
| download | qxmpp-59466bbc70b5b51f35458bddac6e7df4203c42b7.tar.gz | |
Add support for X-MESSENGER-OAUTH2 authentication for Windows Live Messenger.
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/QXmppConfiguration.cpp | 22 | ||||
| -rw-r--r-- | src/client/QXmppConfiguration.h | 3 | ||||
| -rw-r--r-- | src/client/QXmppOutgoingClient.cpp | 2 |
3 files changed, 27 insertions, 0 deletions
diff --git a/src/client/QXmppConfiguration.cpp b/src/client/QXmppConfiguration.cpp index 336630ee..eb30e0df 100644 --- a/src/client/QXmppConfiguration.cpp +++ b/src/client/QXmppConfiguration.cpp @@ -43,6 +43,9 @@ public: QString facebookAccessToken; QString facebookAppId; + // Windows Live + QString windowsLiveAccessToken; + // default is false bool autoAcceptSubscriptions; // default is true @@ -328,6 +331,25 @@ void QXmppConfiguration::setFacebookAppId(const QString& appId) d->facebookAppId = appId; } +/// Returns the access token used for X-MESSENGER-OAUTH2 authentication. + +QString QXmppConfiguration::windowsLiveAccessToken() const +{ + return d->windowsLiveAccessToken; +} + +/// Sets the access token used for X-MESSENGER-OAUTH2 authentication. +/// +/// This token is returned by Windows Live at the end of the OAuth authentication +/// process. +/// +/// \param accessToken + +void QXmppConfiguration::setWindowsLiveAccessToken(const QString& accessToken) +{ + d->windowsLiveAccessToken = accessToken; +} + /// Returns the auto-accept-subscriptions-request configuration. /// /// \return boolean value diff --git a/src/client/QXmppConfiguration.h b/src/client/QXmppConfiguration.h index c578cd74..dc384520 100644 --- a/src/client/QXmppConfiguration.h +++ b/src/client/QXmppConfiguration.h @@ -107,6 +107,9 @@ public: QString facebookAppId() const; void setFacebookAppId(const QString&); + QString windowsLiveAccessToken() const; + void setWindowsLiveAccessToken(const QString &accessToken); + bool autoAcceptSubscriptions() const; void setAutoAcceptSubscriptions(bool); diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index 3c480155..c3e6c1f9 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -395,6 +395,8 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) if (d->saslClient->mechanism() == "X-FACEBOOK-PLATFORM") { d->saslClient->setUsername(configuration().facebookAppId()); d->saslClient->setPassword(configuration().facebookAccessToken()); + } else if (d->saslClient->mechanism() == "X-MESSENGER-OAUTH2") { + d->saslClient->setPassword(configuration().windowsLiveAccessToken()); } else { d->saslClient->setUsername(configuration().user()); d->saslClient->setPassword(configuration().password()); |
