aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Channel.hpp10
-rw-r--r--include/User.hpp1
2 files changed, 10 insertions, 1 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp
index 535cce5..17128fd 100644
--- a/include/Channel.hpp
+++ b/include/Channel.hpp
@@ -4,6 +4,7 @@
#include "Chatbar.hpp"
#include "User.hpp"
#include "Channel.hpp"
+#include "types.hpp"
#include <vector>
#include <odhtdb/DatabaseNode.hpp>
#include <odhtdb/Signature.hpp>
@@ -16,6 +17,12 @@ namespace odhtdb
namespace dchat
{
+ enum class ChannelDataType : u8
+ {
+ MESSAGE,
+ NICKNAME_CHANGE
+ };
+
class Channel
{
public:
@@ -30,7 +37,7 @@ namespace dchat
const std::string& getName() const;
const std::vector<User*> getUsers() const;
- User* getUserByPublicKey(const odhtdb::Signature::PublicKey &publicKey);
+ OnlineUser* getUserByPublicKey(const odhtdb::Signature::PublicKey &publicKey);
const odhtdb::DatabaseNode& getNodeInfo() const;
// If timestamp is 0, then timestamp is not used
@@ -39,6 +46,7 @@ namespace dchat
void addUserLocally(User *user);
bool addUser(const odhtdb::Signature::PublicKey &userId, const std::string &groupId);
void replaceLocalUser(User *newLocalUser);
+ void changeNick(const std::string &newNick);
void processEvent(const sf::Event &event);
void draw(sf::RenderWindow &window, Cache &cache);
diff --git a/include/User.hpp b/include/User.hpp
index e9e334a..821be6f 100644
--- a/include/User.hpp
+++ b/include/User.hpp
@@ -32,6 +32,7 @@ namespace dchat
OnlineUser(const odhtdb::User *databaseUser);
virtual const std::string& getName() const override;
+ std::string name;
const odhtdb::User *databaseUser;
};