]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/client.c
Merge branch 'move-connection-password' of git://arthur.barton.de/ngircd-alex
[ngircd-alex.git] / src / ngircd / client.c
index 5ca99c03570c20b97bb92ab40b58f0c82c6f5f27..0d2d4147345046b87f7f3c6e46fd018749f4da36 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2012 Alexander Barton (alex@barton.de)
  *
  * 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
@@ -885,6 +885,16 @@ Client_CheckNick(CLIENT *Client, char *Nick)
                return false;
        }
 
+       if (Client_Type(Client) != CLIENT_SERVER
+           && Client_Type(Client) != CLIENT_SERVICE) {
+               /* Make sure that this isn't a restricted/forbidden nick name */
+               if (Conf_NickIsBlocked(Nick)) {
+                       IRC_WriteStrClient(Client, ERR_FORBIDDENNICKNAME_MSG,
+                                          Client_ID(Client), Nick);
+                       return false;
+               }
+       }
+
        /* Nickname already registered? */
        if (Client_Search(Nick)) {
                IRC_WriteStrClient(Client, ERR_NICKNAMEINUSE_MSG,
@@ -1155,7 +1165,7 @@ Client_Introduce(CLIENT *From, CLIENT *Client, int Type)
        Client_SetType(Client, Type);
 
        if (From) {
-               if (Conf_IsService(Conf_GetServer(Client_Conn(From)),
+               if (Conf_NickIsService(Conf_GetServer(Client_Conn(From)),
                                   Client_ID(Client)))
                        Client_SetType(Client, CLIENT_SERVICE);
                LogDebug("%s \"%s\" (+%s) registered (via %s, on %s, %d hop%s).",