From d3f698dbad2bc335765ee931781229cc0f0d123d Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sat, 12 Nov 2011 11:40:45 +0100 Subject: Removed some Channel and ChannelTab related silliness * Channel always has a ChannelTab, so need to check it for null * Removed duplicate handling of 'topic' command * No need to set Channel::mTab twice Reviewed-by: Yohann Ferreira --- src/net/manaserv/chathandler.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/net') 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 { -- cgit v1.2.3-70-g09d2