diff options
| author | Linus Jahn <lnj@kaidan.im> | 2019-10-20 16:53:00 +0200 |
|---|---|---|
| committer | LNJ <lnj@kaidan.im> | 2019-10-21 15:39:33 +0200 |
| commit | 4af8f27d6bcbb44d349f4637d4653ac6ca3de09c (patch) | |
| tree | dd7e842ec7dc8f2ab3c39b8a2ff573f67728f7bd /src/base | |
| parent | 99e39f422a27bd24d1d39a86137438d31f4ec01e (diff) | |
| download | qxmpp-4af8f27d6bcbb44d349f4637d4653ac6ca3de09c.tar.gz | |
Revert "Implement MIX-PAM XEP-0405: Roster IQ extension"
This reverts commit 740a085ef7ac707e2cc2217edf02e296c3f7692e.
There were talks on the standards mailing list that the XEP will be
changed and a private PEP node is used for distributing joined channels.
Also no server (that I am aware of) supports the MIX roster extension,
so I think it is the best we remove before the next release, so we do
not have problems with deprecations and ABI compatibility.
Diffstat (limited to 'src/base')
| -rw-r--r-- | src/base/QXmppRosterIq.cpp | 88 | ||||
| -rw-r--r-- | src/base/QXmppRosterIq.h | 11 |
2 files changed, 6 insertions, 93 deletions
diff --git a/src/base/QXmppRosterIq.cpp b/src/base/QXmppRosterIq.cpp index 1aed24cc..f569950b 100644 --- a/src/base/QXmppRosterIq.cpp +++ b/src/base/QXmppRosterIq.cpp @@ -36,8 +36,6 @@ public: QList<QXmppRosterIq::Item> items; // XEP-0237 Roster Versioning QString version; - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - bool mixAnnotate = false; }; QXmppRosterIq::QXmppRosterIq() @@ -85,21 +83,6 @@ void QXmppRosterIq::setVersion(const QString &version) d->version = version; } -/// Whether to annotate which items are MIX channels. - -bool QXmppRosterIq::mixAnnotate() const -{ - return d->mixAnnotate; -} - -/// Sets whether to include which roster items are MIX channels. This MUST only -/// be enabled in get requests. - -void QXmppRosterIq::setMixAnnotate(bool mixAnnotate) -{ - d->mixAnnotate = mixAnnotate; -} - /// \cond bool QXmppRosterIq::isRosterIq(const QDomElement &element) { @@ -109,20 +92,16 @@ bool QXmppRosterIq::isRosterIq(const QDomElement &element) void QXmppRosterIq::parseElementFromChild(const QDomElement &element) { QDomElement queryElement = element.firstChildElement("query"); - setVersion(queryElement.attribute("ver")); - QDomElement itemElement = queryElement.firstChildElement("item"); + + setVersion(queryElement.attribute("ver")); while(!itemElement.isNull()) { QXmppRosterIq::Item item; item.parse(itemElement); d->items.append(item); - itemElement = itemElement.nextSiblingElement("item"); + itemElement = itemElement.nextSiblingElement(); } - - QDomElement annotateElement = queryElement.firstChildElement("annotate"); - setMixAnnotate(!annotateElement.isNull() && annotateElement.namespaceURI() - == ns_mix_roster); } void QXmppRosterIq::toXmlElementFromChild(QXmlStreamWriter *writer) const @@ -131,17 +110,9 @@ void QXmppRosterIq::toXmlElementFromChild(QXmlStreamWriter *writer) const writer->writeAttribute( "xmlns", 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()) - writer->writeAttribute("ver", version()); - - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - if (d->mixAnnotate) { - writer->writeStartElement("annotate"); - writer->writeAttribute("xmlns", ns_mix_roster); - writer->writeEndElement(); - } - - for (int i = 0; i < d->items.count(); ++i) + if(!version().isEmpty()) + writer->writeAttribute( "ver", version()); + for(int i = 0; i < d->items.count(); ++i) d->items.at(i).toXml(writer); writer->writeEndElement(); } @@ -156,9 +127,6 @@ public: // can be subscribe/unsubscribe (attribute "ask") QString subscriptionStatus; QSet<QString> groups; - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - bool isMixChannel = false; - QString mixParticipantId; }; /// Constructs a new roster entry. @@ -321,34 +289,6 @@ void QXmppRosterIq::Item::setSubscriptionTypeFromStr(const QString& type) qWarning("QXmppRosterIq::Item::setTypeFromStr(): invalid type"); } -/// Returns whether this is a MIX channel. - -bool QXmppRosterIq::Item::isMixChannel() const -{ - return d->isMixChannel; -} - -/// Sets whether this is a MIX channel. - -void QXmppRosterIq::Item::setIsMixChannel(bool isMixChannel) -{ - d->isMixChannel = isMixChannel; -} - -/// Returns the participant id for this MIX channel. - -QString QXmppRosterIq::Item::mixParticipantId() const -{ - return d->mixParticipantId; -} - -/// Sets the participant id for this MIX channel. - -void QXmppRosterIq::Item::setMixParticipantId(const QString& participantId) -{ - d->mixParticipantId = participantId; -} - /// \cond void QXmppRosterIq::Item::parse(const QDomElement &element) { @@ -363,13 +303,6 @@ void QXmppRosterIq::Item::parse(const QDomElement &element) d->groups << groupElement.text(); groupElement = groupElement.nextSiblingElement("group"); } - - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - QDomElement channelElement = element.firstChildElement("channel"); - if (!channelElement.isNull() && channelElement.namespaceURI() == ns_mix_roster) { - d->isMixChannel = true; - d->mixParticipantId = channelElement.attribute("participant-id"); - } } void QXmppRosterIq::Item::toXml(QXmlStreamWriter *writer) const @@ -386,15 +319,6 @@ void QXmppRosterIq::Item::toXml(QXmlStreamWriter *writer) const helperToXmlAddTextElement(writer,"group", *i); ++i; } - - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - if (d->isMixChannel) { - writer->writeStartElement("channel"); - writer->writeAttribute("xmlns", ns_mix_roster); - helperToXmlAddAttribute(writer, "participant-id", d->mixParticipantId); - writer->writeEndElement(); - } - writer->writeEndElement(); } /// \endcond diff --git a/src/base/QXmppRosterIq.h b/src/base/QXmppRosterIq.h index 86ec537d..0929bb72 100644 --- a/src/base/QXmppRosterIq.h +++ b/src/base/QXmppRosterIq.h @@ -80,13 +80,6 @@ public: void setSubscriptionStatus(const QString&); void setSubscriptionType(SubscriptionType); - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - bool isMixChannel() const; - void setIsMixChannel(bool); - - QString mixParticipantId() const; - void setMixParticipantId(const QString&); - /// \cond void parse(const QDomElement &element); void toXml(QXmlStreamWriter *writer) const; @@ -111,10 +104,6 @@ public: void addItem(const Item&); QList<Item> items() const; - // XEP-0405: Mediated Information eXchange (MIX): Participant Server Requirements - bool mixAnnotate() const; - void setMixAnnotate(bool); - /// \cond static bool isRosterIq(const QDomElement &element); /// \endcond |
