Skip to content

Commit

Permalink
XEP 0283: Moved - Introduce QXmppMovedItem and QXmppMovedManager
Browse files Browse the repository at this point in the history
This will be used to handle publishing moved statement later and allow
to handle moved users.
  • Loading branch information
pasnox authored and lnjX committed Oct 8, 2024
1 parent 1aeaa06 commit 241c09b
Show file tree
Hide file tree
Showing 10 changed files with 785 additions and 12 deletions.
8 changes: 8 additions & 0 deletions doc/doap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ SPDX-License-Identifier: CC0-1.0
<xmpp:since>1.0</xmpp:since>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource='https://xmpp.org/extensions/xep-0283.html'/>
<xmpp:status>complete</xmpp:status>
<xmpp:version>0.2.0</xmpp:version>
<xmpp:since>1.8</xmpp:since>
</xmpp:SupportedXep>
</implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource='https://xmpp.org/extensions/xep-0293.html'/>
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ set(INSTALL_HEADER_FILES
client/QXmppMessageHandler.h
client/QXmppMessageReceiptManager.h
client/QXmppMixManager.h
client/QXmppMovedManager.h
client/QXmppMucManager.h
client/QXmppOutgoingClient.h
client/QXmppRegistrationManager.h
Expand Down Expand Up @@ -267,6 +268,7 @@ set(SOURCE_FILES
client/QXmppMamManager.cpp
client/QXmppMessageReceiptManager.cpp
client/QXmppMixManager.cpp
client/QXmppMovedManager.cpp
client/QXmppMucManager.cpp
client/QXmppOutgoingClient.cpp
client/QXmppRosterManager.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/base/QXmppConstants_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ inline constexpr QStringView ns_thumbs = u"urn:xmpp:thumbs:1";
inline constexpr QStringView ns_muji = u"urn:xmpp:jingle:muji:0";
// XEP-0280: Message Carbons
inline constexpr QStringView ns_carbons = u"urn:xmpp:carbons:2";
// XEP-0283: Moved
inline constexpr QStringView ns_moved = u"urn:xmpp:moved:1";
// XEP-0293: Jingle RTP Feedback Negotiation
inline constexpr QStringView ns_jingle_rtp_feedback_negotiation = u"urn:xmpp:jingle:apps:rtp:rtcp-fb:0";
// XEP-0294: Jingle RTP Header Extensions Negotiation
Expand Down
30 changes: 30 additions & 0 deletions src/client/QXmppMovedItem_p.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-FileCopyrightText: 2024 Filipe Azevedo <[email protected]>
//
// SPDX-License-Identifier: LGPL-2.1-or-later

#ifndef QXMPPMOVEDITEM_P_H
#define QXMPPMOVEDITEM_P_H

#include <QXmppPubSubBaseItem.h>

class QXmppMovedItem : public QXmppPubSubBaseItem
{
public:
QXmppMovedItem(const QString &newJid = {});

QString newJid() const { return m_newJid; }
void setNewJid(const QString &newJid) { m_newJid = newJid; }

static bool isItem(const QDomElement &itemElement);

protected:
/// \cond
void parsePayload(const QDomElement &payloadElement) override;
void serializePayload(QXmlStreamWriter *writer) const override;
/// \endcond

private:
QString m_newJid;
};

#endif // QXMPPMOVEDITEM_P_H
Loading

0 comments on commit 241c09b

Please sign in to comment.