From f312239c8cae0a2aa58edcdc0589479229c98b55 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 12 Aug 2010 08:24:29 +0000 Subject: make QXmppNonSASLAuthIq parsing/serialisation symetric --- src/QXmppStream.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/QXmppStream.cpp') diff --git a/src/QXmppStream.cpp b/src/QXmppStream.cpp index d4625ba3..afa42351 100644 --- a/src/QXmppStream.cpp +++ b/src/QXmppStream.cpp @@ -653,8 +653,7 @@ void QXmppStream::parser(const QByteArray& data) // xmpp connection made emit xmppConnected(); } - else if(nodeRecv.firstChildElement("query"). - namespaceURI() == ns_auth) + else if(QXmppNonSASLAuthIq::isNonSASLAuthIq(nodeRecv)) { if(type == "result") { @@ -678,7 +677,8 @@ void QXmppStream::parser(const QByteArray& data) plainText = false; else { - //TODO Login error + warning("No supported Non-SASL Authentication mechanism available"); + disconnect(); return; } sendNonSASLAuth(plainText); @@ -814,10 +814,11 @@ void QXmppStream::sendNonSASLAuth(bool plainText) QXmppNonSASLAuthIq authQuery; authQuery.setType(QXmppIq::Set); authQuery.setUsername(configuration().user()); - authQuery.setPassword(configuration().passwd()); + if (plainText) + authQuery.setPassword(configuration().passwd()); + else + authQuery.setDigest(d->streamId, configuration().passwd()); authQuery.setResource(configuration().resource()); - authQuery.setStreamId(d->streamId); - authQuery.setUsePlainText(plainText); d->nonSASLAuthId = authQuery.id(); sendPacket(authQuery); } -- cgit v1.2.3