diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-13 16:50:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-13 16:50:23 +0300 |
commit | 84e2c79004f42656660a32f4b54277954f7ec631 (patch) | |
tree | f83d6d2d22bd38145cac2a1023000db7d3c2e74a /src/gui/windows | |
parent | 00345798a405d4e28f489d01a2dea6afb01a6c18 (diff) | |
download | mv-84e2c79004f42656660a32f4b54277954f7ec631.tar.gz mv-84e2c79004f42656660a32f4b54277954f7ec631.tar.bz2 mv-84e2c79004f42656660a32f4b54277954f7ec631.tar.xz mv-84e2c79004f42656660a32f4b54277954f7ec631.zip |
eathena: show channel messages in channel tab.
Diffstat (limited to 'src/gui/windows')
-rw-r--r-- | src/gui/windows/chatwindow.cpp | 31 | ||||
-rw-r--r-- | src/gui/windows/chatwindow.h | 6 |
2 files changed, 37 insertions, 0 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 4abc70561..5cf727d92 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -1559,6 +1559,10 @@ bool ChatWindow::resortChatLog(std::string line, ChatMsgType::Type own, ignoreRecord, tryRemoveColors); } } + else if (serverFeatures->haveChatChannels()) + { + channelChatLog(channel, line, own, ignoreRecord, tryRemoveColors); + } else if (mShowAllLang) { localChatTab->chatLog(prefix + line, own, @@ -1584,6 +1588,33 @@ void ChatWindow::battleChatLog(const std::string &line, ChatMsgType::Type own, debugChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors); } +void ChatWindow::channelChatLog(const std::string &channel, + const std::string &line, + ChatMsgType::Type own, + const bool ignoreRecord, + const bool tryRemoveColors) +{ + std::string tempChannel = channel; + toLower(tempChannel); + + ChannelTab *tab = nullptr; + const ChannelMap::const_iterator i = mChannels.find(tempChannel); + + if (i != mChannels.end()) + { + tab = i->second; + } + else + { + tab = addChannelTab(channel, false); + if (tab) + saveState(); + } + + if (tab) + tab->chatLog(line, own, ignoreRecord, tryRemoveColors); +} + void ChatWindow::localPetSay(const std::string &nick, const std::string &text) { Being *const being = actorManager->findBeingByName( diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index 068ec4111..b21930bd0 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -223,6 +223,12 @@ class ChatWindow final : public Window, const bool ignoreRecord = false, const bool tryRemoveColors = true); + void channelChatLog(const std::string &channel, + const std::string &line, + ChatMsgType::Type own, + const bool ignoreRecord, + const bool tryRemoveColors); + void updateOnline(const std::set<std::string> &onlinePlayers) const; void loadState(); |