aboutsummaryrefslogtreecommitdiff
path: root/include/Message.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-04-08 21:04:12 +0200
committerdec05eba <dec05eba@protonmail.com>2019-04-08 21:04:17 +0200
commit725ea566a2b6a12e0a02e4f570b6e99102e2d21b (patch)
treed35a338392e15f50402c2055d520e7b1c3ea36a2 /include/Message.hpp
parent4aac8df198e3a5bd9c6efc95cdf4c520c2e05401 (diff)
Refactor, remove a lot of code and use dchat core instead
Diffstat (limited to 'include/Message.hpp')
-rw-r--r--include/Message.hpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/include/Message.hpp b/include/Message.hpp
index 2327a0b..0541574 100644
--- a/include/Message.hpp
+++ b/include/Message.hpp
@@ -1,29 +1,20 @@
#pragma once
-#include "User.hpp"
+#include <memory>
#include "Text.hpp"
-#include <string>
-#include <vector>
-#include <odhtdb/Hash.hpp>
namespace dchat
{
+ struct RoomMessage;
+
class Message
{
public:
- enum class Type
- {
- REGULAR,
- EDITED
- };
-
- // If timestamp is 0, then timestamp is not used
- Message(User *user, const std::string &text, u64 timestampSeconds = 0, bool plainText = false);
-
- const User *user;
+ Message(std::shared_ptr<RoomMessage> roomMessage, bool plainText);
+
+ std::shared_ptr<RoomMessage> roomMessage;
Text text;
- const u64 timestampSeconds;
- Type type;
- odhtdb::Hash id;
+
+ bool onlineUser;
};
-}
+} \ No newline at end of file