summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-26 09:42:43 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-26 09:42:43 -0600
commit9e4a8ea095a1a0613d7b128f4e29c69643137b07 (patch)
tree82dfb0a17dfc3439554efc77a3d18bf5165cebc3 /src/gui/chat.cpp
parentcdcadf6e99a6deaa5b929cdec9736ab1fb280f65 (diff)
downloadmana-9e4a8ea095a1a0613d7b128f4e29c69643137b07.tar.gz
mana-9e4a8ea095a1a0613d7b128f4e29c69643137b07.tar.bz2
mana-9e4a8ea095a1a0613d7b128f4e29c69643137b07.tar.xz
mana-9e4a8ea095a1a0613d7b128f4e29c69643137b07.zip
Add ChannelTab for chat channels
This fixes TMWServ compilation form the previous commit.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 5c15580d..8961b704 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -34,6 +34,7 @@
#include "../configuration.h"
#include "../localplayer.h"
+#include "../utils/dtor.h"
#include "../utils/stringutils.h"
#ifdef TMWSERV_SUPPORT
@@ -94,6 +95,7 @@ ChatWindow::~ChatWindow()
config.setValue("ReturnToggles", mReturnToggles ? "1" : "0");
delete mRecorder;
#endif
+ delete_all(mTabs);
delete mItemLinkHandler;
}
@@ -140,13 +142,15 @@ void ChatWindow::logic()
void ChatWindow::chatLog(std::string line, int own, std::string channelName,
bool ignoreRecord)
{
- if(channelName.empty())
+ ChatTab *tab;
+ if(!channelName.empty())
+ tab = findTab(channelName);
+ else
#ifdef TMWSERV_SUPPORT
- channelName = getFocused();
+ tab = getFocused();
#else
- channelName = "General";
+ tab = findTab("General");
#endif
- ChatTab *tab = findTab(channelName);
tab->chatLog(line, own, ignoreRecord);
}