From 9b21bef379d94876908cbb706c9ba2438779bf54 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 29 Sep 2021 13:15:53 +0200 Subject: PubSubManager: Add node configuration requests --- src/base/QXmppPubSubIq.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/base/QXmppPubSubIq.cpp') diff --git a/src/base/QXmppPubSubIq.cpp b/src/base/QXmppPubSubIq.cpp index 367b0ec0..5ba2615b 100644 --- a/src/base/QXmppPubSubIq.cpp +++ b/src/base/QXmppPubSubIq.cpp @@ -607,8 +607,17 @@ void QXmppPubSubIqBase::toXmlElementFromChild(QXmlStreamWriter *writer) const case OwnerDefault: case Options: if (auto form = d->dataForm) { - // make sure data form type is submit - form->setType(QXmppDataForm::Submit); + // make sure data form type is correct + switch (type()) { + case QXmppIq::Result: + form->setType(QXmppDataForm::Result); + break; + default: + if (form->type() != QXmppDataForm::Cancel) { + form->setType(QXmppDataForm::Submit); + } + break; + } form->toXml(writer); } break; -- cgit v1.2.3