summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorErik Schilling <ablu.erikschilling@googlemail.com>2012-01-06 05:37:16 +0800
committerErik Schilling <ablu.erikschilling@googlemail.com>2012-01-06 21:41:32 +0800
commit7a9c5623cc4d69616321c87a7eeb0876694acafe (patch)
tree44d813d591f4e7c7b5a0006717a778a2ce2c8bb5 /src/gui/chat.cpp
parent440e43491c5abcfcd7bf502d68d4e0d83eb6790b (diff)
downloadmana-client-7a9c5623cc4d69616321c87a7eeb0876694acafe.tar.gz
mana-client-7a9c5623cc4d69616321c87a7eeb0876694acafe.tar.bz2
mana-client-7a9c5623cc4d69616321c87a7eeb0876694acafe.tar.xz
mana-client-7a9c5623cc4d69616321c87a7eeb0876694acafe.zip
Made announcements spreading over all whispers and channels
Resolves: Mana-mantis #430. Reviewed-by: Bertram.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 491542a8..0e75bda3 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -22,6 +22,8 @@
#include "chat.h"
#include "actorspritemanager.h"
+#include "channel.h"
+#include "channelmanager.h"
#include "configuration.h"
#include "localplayer.h"
#include "party.h"
@@ -31,6 +33,7 @@
#include "gui/setup.h"
#include "gui/sdlinput.h"
+#include "gui/widgets/channeltab.h"
#include "gui/widgets/chattab.h"
#include "gui/widgets/itemlinkhandler.h"
#include "gui/widgets/scrollarea.h"
@@ -399,7 +402,24 @@ void ChatWindow::event(Event::Channel channel, const Event &event)
}
else if (event.getType() == Event::Announcement)
{
+ // Show on local tab
localChatTab->chatLog(event.getString("message"), BY_GM);
+ // Spread over channels
+ for (std::list<Channel*>::iterator
+ it = channelManager->mChannels.begin(),
+ it_end = channelManager->mChannels.end();
+ it != it_end; ++it)
+ {
+ if (*it)
+ (*it)->getTab()->chatLog(event.getString("message"), BY_GM);
+ }
+ // Spread over whispers
+ for (TabMap::const_iterator it = mWhispers.begin(),
+ it_end = mWhispers.end(); it != it_end; ++it)
+ {
+ if (it->second)
+ it->second->chatLog(event.getString("message"), BY_GM);
+ }
}
else if (event.getType() == Event::Being)
{