Another year is about to end... So we have to update these damn copyright information :P
[NeonServV5.git] / src / cmd_neonserv_addban.c
index 66d1a6bd588cc925fc376bec92468f6e2fe7766f..fffadf53108180897450f31270b52b8b748fe1e3 100644 (file)
@@ -1,5 +1,5 @@
-/* cmd_neonserv_addban.c - NeonServ v5.0
- * Copyright (C) 2011  Philipp Kreil (pk910)
+/* cmd_neonserv_addban.c - NeonServ v5.3
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -74,6 +74,10 @@ static void neonserv_cmd_addban_async1(struct ClientSocket *client, struct Clien
                 reply(textclient, user, "NS_SERVICE_IMMUNE", chanuser->user->nick);
                 return;
             }
+            if(cuser == user || ((cuser->flags & USERFLAG_ISAUTHED) && !stricmp(user->auth, cuser->auth))) {
+                reply(textclient, user, "NS_YOU_PROTECTED");
+                return;
+            }
             if(isUserProtected(chan, cuser, user)) {
                 reply(textclient, user, "NS_USER_PROTECTED", cuser->nick);
                 return;
@@ -116,7 +120,7 @@ static void neonserv_cmd_addban_async1(struct ClientSocket *client, struct Clien
         cuser = chanuser->user;
         sprintf(usermask, "%s!%s@%s", cuser->nick, cuser->ident, cuser->host);
         if(!match(mask, usermask)) {
-            putsock(client, "KICK %s %s :%s", chan->name, cuser->nick, reason);
+            putsock(client, "KICK %s %s :(%s) %s", chan->name, cuser->nick, user->nick, reason);
         }
     }
     reply(textclient, user, "NS_ADDBAN_DONE", mask, chan->name, match_count);