aboutsummaryrefslogtreecommitdiff
path: root/src/QXmppStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QXmppStream.cpp')
-rw-r--r--src/QXmppStream.cpp13
1 files changed, 7 insertions, 6 deletions
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);
}