aboutsummaryrefslogtreecommitdiff
path: root/src/Channel.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-29 08:17:30 +0200
committerdec05eba <dec05eba@protonmail.com>2018-04-29 08:17:36 +0200
commitf90a5705bd65a4ebb5edc9df003a383039fec555 (patch)
treef0180d946bddc15a0a13d9148562418cb3a4108e /src/Channel.cpp
parent68dcd3c4e17355e1c2b640fe1382743d7cb61ea2 (diff)
Change design, fix crash when closing application
Diffstat (limited to 'src/Channel.cpp')
-rw-r--r--src/Channel.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/Channel.cpp b/src/Channel.cpp
index ef252f6..4fa99a0 100644
--- a/src/Channel.cpp
+++ b/src/Channel.cpp
@@ -1,6 +1,4 @@
#include "../include/Channel.hpp"
-#include "../include/UsersSidePanel.hpp"
-#include "../include/ChannelSidePanel.hpp"
#include <odhtdb/User.hpp>
#include <odhtdb/Database.hpp>
#include <cstring>
@@ -9,6 +7,8 @@ using namespace std;
namespace dchat
{
+ static Channel *currentChannel;
+
Channel::Channel(const string &_name, const odhtdb::DatabaseNode &_databaseNodeInfo, User *_localUser, odhtdb::Database *_database) :
database(_database),
databaseNodeInfo(_databaseNodeInfo),
@@ -131,9 +131,17 @@ namespace dchat
void Channel::draw(sf::RenderWindow &window, Cache &cache)
{
- ChannelSidePanel::draw(window);
messageBoard.draw(window, cache);
chatbar.draw(window);
- UsersSidePanel::draw(window);
+ }
+
+ void Channel::setCurrent(Channel *channel)
+ {
+ currentChannel = channel;
+ }
+
+ Channel* Channel::getCurrent()
+ {
+ return currentChannel;
}
}