File indexing completed on 2024-12-08 04:33:20
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 #include "libruqolacore_export.h" 0009 #include <QDebug> 0010 #include <QJsonObject> 0011 0012 class LIBRUQOLACORE_EXPORT ModerationReportInfo 0013 { 0014 public: 0015 ModerationReportInfo(); 0016 ~ModerationReportInfo(); 0017 0018 [[nodiscard]] bool operator==(const ModerationReportInfo &other) const; 0019 [[nodiscard]] QString description() const; 0020 void setDescription(const QString &newDescription); 0021 0022 [[nodiscard]] QString reportIdentifier() const; 0023 void setReportIdentifier(const QString &newReportIdentifier); 0024 0025 void parseModerationReportInfo(const QJsonObject &o); 0026 0027 [[nodiscard]] qint64 timeStamp() const; 0028 void setTimeStamp(qint64 newTimeStamp); 0029 0030 [[nodiscard]] QString roomId() const; 0031 void setRoomId(const QString &newRoomId); 0032 0033 [[nodiscard]] QString userId() const; 0034 void setUserId(const QString &newUserId); 0035 0036 [[nodiscard]] QString userName() const; 0037 void setUserName(const QString &newUserName); 0038 0039 [[nodiscard]] QString timeStampDateTimeStr() const; 0040 0041 private: 0042 LIBRUQOLACORE_NO_EXPORT void parseRoom(const QJsonObject &o); 0043 LIBRUQOLACORE_NO_EXPORT void parseReportedBy(const QJsonObject &o); 0044 QString mTimeStampDateTimeStr; 0045 QString mDescription; 0046 QString mReportIdentifier; 0047 QString mRoomId; 0048 QString mUserName; 0049 QString mUserId; 0050 qint64 mTimeStamp = -1; 0051 }; 0052 Q_DECLARE_METATYPE(ModerationReportInfo) 0053 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const ModerationReportInfo &t);