forked from qxmpp-project/qxmpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO: Create PR that includes xsf/xeps#919 and a version block
- Loading branch information
Showing
19 changed files
with
5,209 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
// SPDX-FileCopyrightText: 2023 Melvin Keskin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
#pragma once | ||
|
||
#include "QXmppDataForm.h" | ||
#include "QXmppPubSubBaseItem.h" | ||
|
||
class QXmppMixConfigItemPrivate; | ||
|
||
class QXMPP_EXPORT QXmppMixConfigItem : public QXmppPubSubBaseItem | ||
{ | ||
public: | ||
enum class Role { | ||
None, | ||
Owner, | ||
Administrator, | ||
Participant, | ||
Allowed, | ||
Anyone, | ||
Nobody, | ||
}; | ||
|
||
enum class Node { | ||
AllowedJids = 1 << 0, | ||
AvatarData = 1 << 1, | ||
AvatarMetadata = 1 << 2, | ||
BannedJids = 1 << 3, | ||
Configuration = 1 << 4, | ||
Information = 1 << 5, | ||
JidMap = 1 << 6, | ||
Messages = 1 << 7, | ||
Participants = 1 << 8, | ||
Presence = 1 << 9, | ||
}; | ||
Q_DECLARE_FLAGS(Nodes, Node) | ||
|
||
QXmppMixConfigItem(); | ||
QXmppMixConfigItem(const QXmppMixConfigItem &); | ||
QXmppMixConfigItem(QXmppMixConfigItem &&); | ||
~QXmppMixConfigItem(); | ||
|
||
QXmppMixConfigItem &operator=(const QXmppMixConfigItem &); | ||
QXmppMixConfigItem &operator=(QXmppMixConfigItem &&); | ||
|
||
QXmppDataForm::Type formType() const; | ||
void setFormType(QXmppDataForm::Type formType); | ||
|
||
QString lastEditorJid() const; | ||
void setLastEditorJid(const QString &lastEditorJid); | ||
|
||
QStringList ownerJids() const; | ||
void setOwnerJids(const QStringList &ownerJids); | ||
|
||
QStringList administratorJids() const; | ||
void setAdministratorJids(const QStringList &administratorJids); | ||
|
||
QDateTime channelDeletion() const; | ||
void setChannelDeletion(const QDateTime &channelDeletion); | ||
|
||
Nodes nodes() const; | ||
void setNodes(Nodes nodes); | ||
|
||
Role messagesSubscribeRole() const; | ||
void setMessagesSubscribeRole(Role messagesSubscribeRole); | ||
|
||
Role messagesRetractRole() const; | ||
void setMessagesRetractRole(Role messagesRetractRole); | ||
|
||
Role presenceSubscribeRole() const; | ||
void setPresenceSubscribeRole(Role presenceSubscribeRole); | ||
|
||
Role participantsSubscribeRole() const; | ||
void setParticipantsSubscribeRole(Role participantsSubscribeRole); | ||
|
||
Role informationSubscribeRole() const; | ||
void setInformationSubscribeRole(Role informationSubscribeRole); | ||
|
||
Role informationUpdateRole() const; | ||
void setInformationUpdateRole(Role informationUpdateRole); | ||
|
||
Role allowedJidsSubscribeRole() const; | ||
void setAllowedJidsSubscribeRole(Role allowedJidsSubscribeRole); | ||
|
||
Role bannedJidsSubscribeRole() const; | ||
void setBannedJidsSubscribeRole(Role bannedJidsSubscribeRole); | ||
|
||
Role configurationReadRole() const; | ||
void setConfigurationReadRole(Role configurationReadRole); | ||
|
||
Role avatarUpdateRole() const; | ||
void setAvatarUpdateRole(Role avatarUpdateRole); | ||
|
||
std::optional<bool> nicknameRequired() const; | ||
void setNicknameRequired(std::optional<bool> nicknameRequired); | ||
|
||
std::optional<bool> presenceRequired() const; | ||
void setPresenceRequired(std::optional<bool> presenceRequired); | ||
|
||
std::optional<bool> onlyParticipantsPermittedToSubmitPresence() const; | ||
void setOnlyParticipantsPermittedToSubmitPresence(std::optional<bool> onlyParticipantsPermittedToSubmitPresence); | ||
|
||
std::optional<bool> ownMessageRetractionPermitted() const; | ||
void setOwnMessageRetractionPermitted(std::optional<bool> ownMessageRetractionPermitted); | ||
|
||
std::optional<bool> invitationsPermitted() const; | ||
void setInvitationsPermitted(std::optional<bool> invitationsPermitted); | ||
|
||
std::optional<bool> privateMessagesPermitted() const; | ||
void setPrivateMessagesPermitted(std::optional<bool> privateMessagesPermitted); | ||
|
||
static bool isItem(const QDomElement &itemElement); | ||
|
||
protected: | ||
/// \cond | ||
void parsePayload(const QDomElement &payloadElement) override; | ||
void serializePayload(QXmlStreamWriter *writer) const override; | ||
/// \endcond | ||
|
||
private: | ||
QSharedDataPointer<QXmppMixConfigItemPrivate> d; | ||
}; | ||
|
||
Q_DECLARE_OPERATORS_FOR_FLAGS(QXmppMixConfigItem::Nodes) | ||
/// \cond | ||
// Scoped enums (enum class) are not implicitly converted to int. | ||
inline uint qHash(QXmppMixConfigItem::Node key, uint seed) noexcept { return qHash(std::underlying_type_t<QXmppMixConfigItem::Node>(key), seed); } | ||
/// \endcond | ||
|
||
Q_DECLARE_METATYPE(QXmppMixConfigItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
// SPDX-FileCopyrightText: 2019 Linus Jahn <[email protected]> | ||
// SPDX-FileCopyrightText: 2023 Melvin Keskin <[email protected]> | ||
// | ||
// SPDX-License-Identifier: LGPL-2.1-or-later | ||
|
||
#ifndef QXMPPMIXINFOITEM_H | ||
#define QXMPPMIXINFOITEM_H | ||
#pragma once | ||
|
||
#include "QXmppDataForm.h" | ||
#include "QXmppPubSubBaseItem.h" | ||
|
||
class QXmppMixInfoItemPrivate; | ||
|
@@ -20,6 +21,9 @@ class QXMPP_EXPORT QXmppMixInfoItem : public QXmppPubSubBaseItem | |
QXmppMixInfoItem &operator=(const QXmppMixInfoItem &); | ||
QXmppMixInfoItem &operator=(QXmppMixInfoItem &&); | ||
|
||
QXmppDataForm::Type formType() const; | ||
void setFormType(QXmppDataForm::Type formType); | ||
|
||
const QString &name() const; | ||
void setName(QString); | ||
|
||
|
@@ -41,4 +45,4 @@ class QXMPP_EXPORT QXmppMixInfoItem : public QXmppPubSubBaseItem | |
QSharedDataPointer<QXmppMixInfoItemPrivate> d; | ||
}; | ||
|
||
#endif // QXMPPMIXINFOITEM_H | ||
Q_DECLARE_METATYPE(QXmppMixInfoItem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.