summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index f11f23ef..31f6e279 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -23,6 +23,7 @@
#include "actorspritemanager.h"
#include "configuration.h"
+#include "event.h"
#include "localplayer.h"
#include "party.h"
@@ -77,6 +78,8 @@ ChatWindow::ChatWindow():
Window(_("Chat")),
mTmpVisible(false)
{
+ listen("Notices");
+
setWindowName("Chat");
setupWindow->registerWindowForReset(this);
@@ -393,6 +396,17 @@ void ChatWindow::keyPressed(gcn::KeyEvent &event)
}
}
+void ChatWindow::event(const std::string &channel, const Mana::Event &event)
+{
+ if (channel == "Notices")
+ {
+ if (event.getName() == "ServerNotice")
+ {
+ localChatTab->chatLog(event.getString("message"), BY_SERVER);
+ }
+ }
+}
+
void ChatWindow::addInputText(const std::string &text)
{
const int caretPos = mChatInput->getCaretPosition();