diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-09-05 20:37:05 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-09-06 00:46:56 +0200 |
| commit | 5f813f8a4bbe1e075daad7b3933829044befffb4 (patch) | |
| tree | 20102aa665b03cfb6dfe0c6ece94938320b6430e /src/base/QXmppRosterIq.cpp | |
| parent | 4c60b13e0b8011e4e0b093a690e939f3b23e2436 (diff) | |
| download | qxmpp-5f813f8a4bbe1e075daad7b3933829044befffb4.tar.gz | |
Reformat code
Diffstat (limited to 'src/base/QXmppRosterIq.cpp')
| -rw-r--r-- | src/base/QXmppRosterIq.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/base/QXmppRosterIq.cpp b/src/base/QXmppRosterIq.cpp index 28f7572d..59f20f0b 100644 --- a/src/base/QXmppRosterIq.cpp +++ b/src/base/QXmppRosterIq.cpp @@ -129,8 +129,9 @@ void QXmppRosterIq::toXmlElementFromChild(QXmlStreamWriter *writer) const writer->writeDefaultNamespace(ns_roster); // XEP-0237 roster versioning - If the server does not advertise support for roster versioning, the client MUST NOT include the 'ver' attribute. - if (!version().isEmpty()) + if (!version().isEmpty()) { writer->writeAttribute(QStringLiteral("ver"), version()); + } // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements if (d->mixAnnotate) { @@ -139,8 +140,9 @@ void QXmppRosterIq::toXmlElementFromChild(QXmlStreamWriter *writer) const writer->writeEndElement(); } - for (int i = 0; i < d->items.count(); ++i) + for (int i = 0; i < d->items.count(); ++i) { d->items.at(i).toXml(writer); + } writer->writeEndElement(); } /// \endcond @@ -336,20 +338,21 @@ QString QXmppRosterIq::Item::getSubscriptionTypeStr() const void QXmppRosterIq::Item::setSubscriptionTypeFromStr(const QString &type) { - if (type.isEmpty()) + if (type.isEmpty()) { setSubscriptionType(NotSet); - else if (type == QStringLiteral("none")) + } else if (type == QStringLiteral("none")) { setSubscriptionType(None); - else if (type == QStringLiteral("both")) + } else if (type == QStringLiteral("both")) { setSubscriptionType(Both); - else if (type == QStringLiteral("from")) + } else if (type == QStringLiteral("from")) { setSubscriptionType(From); - else if (type == QStringLiteral("to")) + } else if (type == QStringLiteral("to")) { setSubscriptionType(To); - else if (type == QStringLiteral("remove")) + } else if (type == QStringLiteral("remove")) { setSubscriptionType(Remove); - else + } else { qWarning("QXmppRosterIq::Item::setTypeFromStr(): invalid type"); + } } /// @@ -426,8 +429,9 @@ void QXmppRosterIq::Item::toXml(QXmlStreamWriter *writer) const helperToXmlAddAttribute(writer, QStringLiteral("name"), d->name); helperToXmlAddAttribute(writer, QStringLiteral("subscription"), getSubscriptionTypeStr()); helperToXmlAddAttribute(writer, QStringLiteral("ask"), subscriptionStatus()); - if (d->approved) + if (d->approved) { writer->writeAttribute(QStringLiteral("approved"), QStringLiteral("true")); + } QSet<QString>::const_iterator i = d->groups.constBegin(); while (i != d->groups.constEnd()) { |
