summaryrefslogtreecommitdiff
path: root/src/gui/chatwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-04-18 22:33:28 +0300
committerAndrei Karas <akaras@inbox.ru>2011-04-18 22:33:28 +0300
commit71ba93abb9436eabc9fed8e4e49ab5cdee47bb38 (patch)
tree87f9fc99f15d84a8a63b3fbc68950650f9ebc0ed /src/gui/chatwindow.cpp
parentbc39b3c006145c6db41e7fcfac9da512944774f3 (diff)
downloadmv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.gz
mv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.bz2
mv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.tar.xz
mv-71ba93abb9436eabc9fed8e4e49ab5cdee47bb38.zip
Impliment away log in away mode.
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r--src/gui/chatwindow.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp
index 372461b29..472c2b531 100644
--- a/src/gui/chatwindow.cpp
+++ b/src/gui/chatwindow.cpp
@@ -1470,3 +1470,29 @@ void ChatWindow::loadCustomList()
listFile.close();
}
}
+
+void ChatWindow::addToAwayLog(std::string line)
+{
+ if (!player_node || !player_node->getAwayMode())
+ return;
+
+ if (mAwayLog.size() > 20)
+ mAwayLog.pop_front();
+
+ if (line.find(player_node->getName()) != std::string::npos)
+ mAwayLog.push_back("##9away:" + line);
+}
+
+void ChatWindow::displayAwayLog()
+{
+ if (!localChatTab)
+ return;
+
+ std::list<std::string>::iterator i = mAwayLog.begin();
+
+ while (i != mAwayLog.end())
+ {
+ localChatTab->addNewRow(*i);
+ ++i;
+ }
+}