diff options
Diffstat (limited to 'include/Channel.hpp')
-rw-r--r-- | include/Channel.hpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/include/Channel.hpp b/include/Channel.hpp index 4bdb4b5..6f5495f 100644 --- a/include/Channel.hpp +++ b/include/Channel.hpp @@ -4,25 +4,45 @@ #include "Chatbar.hpp" #include "User.hpp" #include "Channel.hpp" +#include <vector> +#include <odhtdb/DatabaseNode.hpp> +#include <odhtdb/Signature.hpp> + +namespace odhtdb +{ + class Database; +} namespace dchat { class Channel { public: - Channel(const std::string &name); - ~Channel(); + Channel(const std::string &name, const odhtdb::DatabaseNode &databaseNodeInfo = odhtdb::DatabaseNode(), User *localUser = nullptr, odhtdb::Database *database = nullptr); + virtual ~Channel(); User* getLocalUser(); MessageBoard& getMessageBoard(); + const std::string& getName() const; + const std::vector<User*> getUsers() const; + User* getUserByPublicKey(const odhtdb::Signature::PublicKey &publicKey); + + void addLocalMessage(const std::string &msg, User *owner); + void addMessage(const std::string &msg); + void addUser(User *user); void processEvent(const sf::Event &event); void draw(sf::RenderWindow &window, Cache &cache); - private: + protected: + odhtdb::Database *database; + odhtdb::DatabaseNode databaseNodeInfo; + std::string name; MessageBoard messageBoard; Chatbar chatbar; - OfflineUser localOfflineUser; - std::string name; + User *localUser; + SystemUser systemUser; + std::vector<User*> users; + odhtdb::Signature::MapPublicKey<OnlineUser*> publicKeyOnlineUsersMap; }; } |