diff options
author | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-02-05 20:41:01 +0100 |
---|---|---|
committer | Erik Schilling <ablu.erikschilling@googlemail.com> | 2012-02-05 20:47:03 +0100 |
commit | b7d6b14916d840c8753fc01f6816aa094ee73b2f (patch) | |
tree | e47315df9da7454a01ce9f54dd2cbdc908fc0c56 /src/gui/chatwindow.cpp | |
parent | c0721a0f5cf8694319c1f6849ea32864b31c825a (diff) | |
download | mana-b7d6b14916d840c8753fc01f6816aa094ee73b2f.tar.gz mana-b7d6b14916d840c8753fc01f6816aa094ee73b2f.tar.bz2 mana-b7d6b14916d840c8753fc01f6816aa094ee73b2f.tar.xz mana-b7d6b14916d840c8753fc01f6816aa094ee73b2f.zip |
Fixed spreading over tabs not spamming too much
Now announcements will only get displayed on the current tab + on the local tab
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/gui/chatwindow.cpp')
-rw-r--r-- | src/gui/chatwindow.cpp | 20 |
1 files changed, 4 insertions, 16 deletions
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<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); - } + // 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) { |