]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
Block nicknames that are reserved for services
[ngircd-alex.git] / src / ngircd / conf.c
index 16ad98c21a40c185cc5b371f387e0372a3ee2cbe..41b5469a8140f4c5a07d1874dd6d048fcbf6ae3b 100644 (file)
@@ -651,6 +651,27 @@ Conf_NickIsService(int ConfServer, const char *Nick)
        return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
 }
 
        return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
 }
 
+/**
+ * Check if the given nick name is blocked for "normal client" use.
+ *
+ * @param ConfServer The server index or NONE to check all configured servers.
+ * @param Nick The nick name to check.
+ * @returns true if the given nick name belongs to an "IRC service".
+ */
+GLOBAL bool
+Conf_NickIsBlocked(const char *Nick)
+{
+       int i;
+
+       for(i = 0; i < MAX_SERVERS; i++) {
+               if (!Conf_Server[i].name[0])
+                       continue;
+               if (Conf_NickIsService(i, Nick))
+                       return true;
+       }
+       return false;
+}
+
 /**
  * Initialize configuration settings with their default values.
  */
 /**
  * Initialize configuration settings with their default values.
  */