aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-30 13:54:10 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-30 13:54:13 +0200
commit9e576f9fbcbcc4603689b0b1215cf3d526bd9616 (patch)
treeef90a131458a84b4e993ec3d12dd5022a460248a /include
parent1a967f184e55e2fa989d40e5bbaff3ba1efe54a0 (diff)
Add timestamp to messages
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp3
-rw-r--r--include/Message.hpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index 31a17f4..5650eb1 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -28,7 +28,8 @@ namespace dchat
const std::vector<User*> getUsers() const;
User* getUserByPublicKey(const odhtdb::Signature::PublicKey &publicKey);
- void addLocalMessage(const std::string &msg, User *owner);
+ // If timestamp is 0, then timestamp is not used
+ void addLocalMessage(const std::string &msg, User *owner, u64 timestampSeconds = 0);
void addMessage(const std::string &msg);
void addUser(User *user);
diff --git a/include/Message.hpp b/include/Message.hpp
index a6edddf..2e52603 100644
--- a/include/Message.hpp
+++ b/include/Message.hpp
@@ -10,9 +10,11 @@ namespace dchat
class Message
{
public:
- Message(User *user, const std::string &text);
+ // If timestamp is 0, then timestamp is not used
+ Message(User *user, const std::string &text, u64 timestampSeconds = 0);
const User *user;
Text text;
+ const u64 timestampSeconds;
};
}