Skip to content

Commit

Permalink
WIP: Parse error on handling IQ response
Browse files Browse the repository at this point in the history
  • Loading branch information
melvo committed Oct 20, 2023
1 parent 905daf1 commit ac22e16
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/base/QXmppStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,19 @@ bool QXmppStream::handleIqResponse(const QDomElement &stanza)
return false;
}

itr.value().interface.finish(stanza);
QXmppStream::IqResult result;

QXmppIq iq;
iq.parse(stanza);

if (iq.type() == QXmppIq::Error) {
if (auto error = iq.errorOptional()) {
result = QXmppError { error->text(), std::move(*error) };
}
result = QXmppError { QStringLiteral("Unknown error.") };
}

itr.value().interface.finish(result);
d->runningIqs.erase(itr);
return true;
}
Expand Down

0 comments on commit ac22e16

Please sign in to comment.