File indexing completed on 2024-10-06 04:34:01

0001 /*
0002    SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqola_private_export.h"
0010 #include <QDebug>
0011 class LIBRUQOLACORE_TESTS_EXPORT MessagePinned
0012 {
0013 public:
0014     MessagePinned();
0015 
0016     [[nodiscard]] bool pinned() const;
0017     void setPinned(bool pinned);
0018 
0019     [[nodiscard]] QString pinnedBy() const;
0020     void setPinnedBy(const QString &pinnedBy);
0021 
0022     [[nodiscard]] bool operator==(const MessagePinned &other) const;
0023     void parse(const QJsonObject &o);
0024 
0025     static QJsonObject serialize(const MessagePinned &message);
0026     static MessagePinned deserialize(const QJsonObject &o);
0027 
0028 private:
0029     QString mPinnedBy;
0030     bool mPinned = false;
0031 };
0032 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const MessagePinned &t);