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
17 changed files
with
4,876 additions
and
139 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,130 @@ | ||
// 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 { | ||
None = 0, | ||
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 automaticChannelDeletionDateTime() const; | ||
void setAutomaticChannelDeletionDateTime(const QDateTime &automaticChannelDeletionDateTime); | ||
|
||
Nodes nodes() const; | ||
void setNodes(Nodes nodes); | ||
|
||
Role rolePermittedToSubscribeToMessages() const; | ||
void setRolePermittedToSubscribeToMessages(Role rolePermittedToSubscribeToMessages); | ||
|
||
Role rolePermittedToSubscribeToPresence() const; | ||
void setRolePermittedToSubscribeToPresence(Role rolePermittedToSubscribeToPresence); | ||
|
||
Role rolePermittedToSubscribeToParticipants() const; | ||
void setRolePermittedToSubscribeToParticipants(Role rolePermittedToSubscribeToParticipants); | ||
|
||
Role rolePermittedToSubscribeToInformation() const; | ||
void setRolePermittedToSubscribeToInformation(Role rolePermittedToSubscribeToInformation); | ||
|
||
Role rolePermittedToSubscribeToJidsAllowedToParticipate() const; | ||
void setRolePermittedToSubscribeToJidsAllowedToParticipate(Role rolePermittedToSubscribeToJidsAllowedToParticipate); | ||
|
||
Role rolePermittedToSubscribeToJidsBannedFromParticipating() const; | ||
void setRolePermittedToSubscribeToJidsBannedFromParticipating(Role rolePermittedToSubscribeToJidsBannedFromParticipating); | ||
|
||
Role rolePermittedToReadConfiguration() const; | ||
void setRolePermittedToReadConfiguration(Role rolePermittedToReadConfiguration); | ||
|
||
Role rolePermittedToUpdateInformation() const; | ||
void setRolePermittedToUpdateInformation(Role rolePermittedToUpdateInformation); | ||
|
||
Role rolePermittedToUpdateAvatars() const; | ||
void setRolePermittedToUpdateAvatars(Role rolePermittedToUpdateAvatars); | ||
|
||
Role rolePermittedToRetractAnyMessage() const; | ||
void setRolePermittedToRetractAnyMessage(Role rolePermittedToRetractAnyMessage); | ||
|
||
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> invitationByParticipantsPermitted() const; | ||
void setInvitationByParticipantsPermitted(std::optional<bool> invitationByParticipantsPermitted); | ||
|
||
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 |
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,12 @@ | ||
// 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 | ||
|
||
#include "QXmppDataForm.h" | ||
#include "QXmppPubSubBaseItem.h" | ||
|
||
class QXmppMixInfoItemPrivate; | ||
|
@@ -20,6 +22,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); | ||
|
||
|
Oops, something went wrong.