aboutsummaryrefslogtreecommitdiff
path: root/src/Message.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-20 01:29:54 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-20 01:31:23 +0200
commit391f7fd6d832cb40f74fb37f9e0af7ff33db202f (patch)
tree1d3e2b54dfade403da579a23029ae98f1a5c8f5b /src/Message.cpp
parentc670ad2839d886107189a5a0d0854a02aa0ace53 (diff)
Add message board, in the middle of text selection
Diffstat (limited to 'src/Message.cpp')
-rw-r--r--src/Message.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Message.cpp b/src/Message.cpp
new file mode 100644
index 0000000..44174ec
--- /dev/null
+++ b/src/Message.cpp
@@ -0,0 +1,30 @@
+#include "../include/Message.hpp"
+
+using namespace std;
+
+namespace dchat
+{
+ Message::Message(User *_user) :
+ user(_user)
+ {
+
+ }
+
+ Message::~Message()
+ {
+ for(MessagePart *messagePart : messageParts)
+ {
+ delete messagePart;
+ }
+ }
+
+ void Message::addText(const string &text)
+ {
+ messageParts.push_back(new MessagePartText(text));
+ }
+
+ vector<MessagePart*>& Message::getParts()
+ {
+ return messageParts;
+ }
+}