forked from CPP-Final-Project/Chat_Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessage.h
More file actions
60 lines (39 loc) · 1.38 KB
/
Message.h
File metadata and controls
60 lines (39 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once
#include <QObject>
#include <QString>
#include <QDateTime>
#include <QHash>
#include <QUuid>
#include "Enums.h"
class User_Message : public QObject
{
Q_OBJECT
Q_DISABLE_COPY(User_Message)
public:
User_Message(const QUuid& id_, const QDateTime& date_time_, const QString& nickname_, const QString& text_, bool is_rtl_, const QString& media_id_ = nullptr, const QString& parent_id_ = nullptr, const bool& deleted_ = false, const QMap<QString, bool>& likes_ = {}, QObject* parent_ = nullptr);
~User_Message() override;
[[nodiscard]] const QUuid& getId() const;
[[nodiscard]] const QDateTime& getDateTime() const;
//[[nodiscard]] quint32 getRoomId() const;
[[nodiscard]] const QString& getNickname() const;
[[nodiscard]] QString getParentId() const;
[[nodiscard]] const QString& getText() const;
[[nodiscard]] const QString& getMedia() const;
[[nodiscard]] bool isDeleted() const;
[[nodiscard]] const QMap<QString, bool>& getLikes() const;
[[nodiscard]] bool isRtl() const;
void setDeleted(bool flag_);
void setLikes(const QMap<QString, bool>& likes_);
private:
QUuid id;
//quint32 room_id {0};
QDateTime date_time;
QString nickname;
QString text;
QString media_id;
QUuid parent_id;
bool is_rtl;
bool deleted {false};
QMap<QString, bool> likes;
};
Q_DECLARE_METATYPE(User_Message)