From 5d8efa68f4e913ec2b25f41d4607d582efaa2ac5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Aug 2014 17:11:15 +0300 Subject: Fix ignore all whispers chat command. --- src/gui/windows/chatwindow.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/gui') diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index eb14628ea..87e6c5b3c 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -572,16 +572,18 @@ void ChatWindow::ignoreAllWhispers() iter != mWhispers.end(); ++ iter) { - const WhisperTab *const tab = dynamic_cast( + WhisperTab *const tab = dynamic_cast( iter->second); - if (tab && player_relations.getRelation(tab->getNick()) - != PlayerRelation::IGNORED) + if (tab) { - player_relations.setRelation(tab->getNick(), - PlayerRelation::IGNORED); + if (player_relations.getRelation(tab->getNick()) + != PlayerRelation::IGNORED) + { + player_relations.setRelation(tab->getNick(), + PlayerRelation::IGNORED); + } + tab->handleCommand("close", ""); } - - delete2(iter->second) } } -- cgit v1.2.3-70-g09d2