From b7d6b14916d840c8753fc01f6816aa094ee73b2f Mon Sep 17 00:00:00 2001 From: Erik Schilling Date: Sun, 5 Feb 2012 20:41:01 +0100 Subject: Fixed spreading over tabs not spamming too much MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now announcements will only get displayed on the current tab + on the local tab Reviewed-by: Thorbjørn Lindeijer --- src/gui/chatwindow.cpp | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'src/gui/chatwindow.cpp') diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 0bf8d493..cc09d19e 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -406,22 +406,10 @@ void ChatWindow::event(Event::Channel channel, const Event &event) { // 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); - } + // Show on selected tab if it is not the global one + ChatTab *selected = getFocused(); + if (selected && selected != localChatTab) + selected->chatLog(event.getString("message"), BY_GM); } else if (event.getType() == Event::Being) { -- cgit v1.2.3-70-g09d2