diff options
-rw-r--r-- | src/channel.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/channeltab.cpp | 5 | ||||
-rw-r--r-- | src/net/manaserv/chathandler.cpp | 7 |
3 files changed, 2 insertions, 14 deletions
diff --git a/src/channel.h b/src/channel.h index ebf96136..2fafb0b6 100644 --- a/src/channel.h +++ b/src/channel.h @@ -73,10 +73,6 @@ class Channel ChannelTab *getTab() { return mTab; } - protected: - friend class ChannelTab; - void setTab(ChannelTab *tab) { mTab = tab; } - private: unsigned short mId; std::string mName; diff --git a/src/gui/widgets/channeltab.cpp b/src/gui/widgets/channeltab.cpp index a7370a4c..31373748 100644 --- a/src/gui/widgets/channeltab.cpp +++ b/src/gui/widgets/channeltab.cpp @@ -32,7 +32,6 @@ ChannelTab::ChannelTab(Channel *channel) : ChatTab(channel->getName()), mChannel(channel) { - channel->setTab(this); } ChannelTab::~ChannelTab() @@ -102,10 +101,6 @@ bool ChannelTab::handleCommand(const std::string &type, { Net::getChatHandler()->setChannelTopic(mChannel->getId(), args); } - else if (type == "topic") - { - Net::getChatHandler()->setChannelTopic(mChannel->getId(), args); - } else if (type == "quit") { Net::getChatHandler()->quitChannel(mChannel->getId()); diff --git a/src/net/manaserv/chathandler.cpp b/src/net/manaserv/chathandler.cpp index efb156f0..b6749e7c 100644 --- a/src/net/manaserv/chathandler.cpp +++ b/src/net/manaserv/chathandler.cpp @@ -254,12 +254,9 @@ void ChatHandler::handleChatMessage(Net::MessageIn &msg) std::string userNick = msg.readString(); std::string chatMsg = msg.readString(); - Channel *channel = channelManager->findById(channelId); - if (channel) + if (Channel *channel = channelManager->findById(channelId)) { - ChannelTab *tab = channel->getTab(); - if (tab) - tab->chatLog(userNick, chatMsg); + channel->getTab()->chatLog(userNick, chatMsg); } else { |