aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-01 13:27:52 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-01 13:28:29 +0200
commit431c1dcded16649c10331b9dc4e57f20067cea0b (patch)
tree3f5327ca81f76ad7c77f36a930d56401a4ec458e /include
parent9e576f9fbcbcc4603689b0b1215cf3d526bd9616 (diff)
Add 'add user', 'join channel'. Improve scrolling. Added locks
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp9
-rw-r--r--include/MessageBoard.hpp1
2 files changed, 9 insertions, 1 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index 5650eb1..be6e7c7 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -7,6 +7,7 @@
#include <vector>
#include <odhtdb/DatabaseNode.hpp>
#include <odhtdb/Signature.hpp>
+#include <odhtdb/Group.hpp>
namespace odhtdb
{
@@ -20,18 +21,24 @@ namespace dchat
public:
Channel(const std::string &name, const odhtdb::DatabaseNode &databaseNodeInfo = odhtdb::DatabaseNode(), User *localUser = nullptr, odhtdb::Database *database = nullptr);
virtual ~Channel();
+ Channel(const Channel& other) = delete;
+ Channel& operator = (const Channel &other) = delete;
User* getLocalUser();
+ SystemUser* getSystemUser();
MessageBoard& getMessageBoard();
const std::string& getName() const;
const std::vector<User*> getUsers() const;
User* getUserByPublicKey(const odhtdb::Signature::PublicKey &publicKey);
+ std::shared_ptr<odhtdb::Hash> getId();
// 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);
+ void addUserLocally(User *user);
+ bool addUser(const odhtdb::Signature::PublicKey &userId, const std::string &groupId);
+ void replaceLocalUser(User *newLocalUser);
void processEvent(const sf::Event &event);
void draw(sf::RenderWindow &window, Cache &cache);
diff --git a/include/MessageBoard.hpp b/include/MessageBoard.hpp
index 739f161..e84396d 100644
--- a/include/MessageBoard.hpp
+++ b/include/MessageBoard.hpp
@@ -36,5 +36,6 @@ namespace dchat
double scrollSpeed;
sf::Clock frameTimer;
double totalHeight;
+ bool scrollToBottom;
};
}