From 7a9c5623cc4d69616321c87a7eeb0876694acafe Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Fri, 6 Jan 2012 05:37:16 +0800 Subject: Made announcements spreading over all whispers and channels Resolves: Mana-mantis #430. Reviewed-by: Bertram. --- src/gui/chat.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/gui') 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::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) { -- cgit v1.2.3-70-g09d2