aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-08 18:36:51 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-08 18:36:55 +0200
commit161b5dbbf43d505b727e0ed3cae15458a72147f9 (patch)
tree156c13e95bcfeee5ce9a27fee633cf1b1db4b94c /include
parent15c4434de0c2cd12e09c2f41e898c0b124194a97 (diff)
Only allow owner of message to delete it
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp4
-rw-r--r--include/MessageBoard.hpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index 7d4cb08..93f3725 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -47,8 +47,8 @@ namespace dchat
void addLocalMessage(const std::string &msg, User *owner, u64 timestampSeconds = 0);
void addLocalMessage(const std::string &msg, User *owner, u64 timestampSeconds, const odhtdb::Hash &id);
void addMessage(const std::string &msg);
- void deleteLocalMessage(const odhtdb::Hash &id);
- void deleteMessage(const odhtdb::Hash &id);
+ void deleteLocalMessage(const odhtdb::Hash &id, const odhtdb::Signature::PublicKey &requestedByUser);
+ void deleteMessage(const odhtdb::Hash &id, const odhtdb::Signature::PublicKey &requestedByUser);
void addUserLocally(User *user);
bool addUser(const odhtdb::Signature::PublicKey &userId, const std::string &groupId);
diff --git a/include/MessageBoard.hpp b/include/MessageBoard.hpp
index a6867d2..9025e48 100644
--- a/include/MessageBoard.hpp
+++ b/include/MessageBoard.hpp
@@ -7,6 +7,7 @@
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>
#include <odhtdb/Hash.hpp>
+#include <odhtdb/Signature.hpp>
#include <stdexcept>
#include <mutex>
@@ -26,7 +27,7 @@ namespace dchat
private:
void updateStaticContentTexture(const sf::Vector2u &newSize);
void addMessage(Message *message, const odhtdb::Hash &id);
- void deleteMessage(const odhtdb::Hash &id);
+ void deleteMessage(const odhtdb::Hash &id, const odhtdb::Signature::PublicKey &requestedByUser);
void drawDefault(sf::RenderWindow &window, Cache &cache);
void drawSimple(sf::RenderWindow &window, Cache &cache);