QTfrontend/ui/widget/chatwidget.cpp
changeset 6929 c305d31642ac
parent 6928 9562ace15141
child 6930 d187ea93fc4f
--- a/QTfrontend/ui/widget/chatwidget.cpp	Wed Apr 25 08:23:48 2012 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Wed Apr 25 17:44:48 2012 +0200
@@ -247,6 +247,7 @@
     this->notify = notify;
 
     m_isAdmin = false;
+    m_autoKickEnabled = false;
 
     if(gameSettings->value("frontend/sound", true).toBool())
     {
@@ -399,6 +400,11 @@
     }
 }
 
+void HWChatWidget::setIgnoreListKick(bool enabled)
+{
+    m_autoKickEnabled = enabled;
+}
+
 void HWChatWidget::loadList(QStringList & list, const QString & file)
 {
     list.clear();
@@ -636,6 +642,13 @@
 void HWChatWidget::nickAdded(const QString & nick, bool notifyNick)
 {
     bool isIgnored = ignoreList.contains(nick, Qt::CaseInsensitive);
+
+    if (isIgnored && m_isAdmin && m_autoKickEnabled)
+    {
+        emit kick(nick);
+        return;
+    }
+
     QListWidgetItem * item = new ListWidgetNickItem(nick, friendsList.contains(nick, Qt::CaseInsensitive), isIgnored);
     updateNickItem(item);
     chatNicks->addItem(item);