]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - modules/core/m_nick.c
Remove various unused macros.
[irc/rqf/shadowircd.git] / modules / core / m_nick.c
index 6fb0dba0546d09402cf7318e4c3e01875f031656..336b8521e2358aa9fcc6d52d1709e2d74e921a2e 100644 (file)
@@ -156,7 +156,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, int parc, const char *
                return 0;
        }
 
-       if(hash_find_nd(nick))
+       if(irc_dictionary_find(nd_dict, nick))
        {
                sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
                           me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
@@ -217,7 +217,7 @@ m_nick(struct Client *client_p, struct Client *source_p, int parc, const char *p
                return 0;
        }
 
-       if(hash_find_nd(nick))
+       if(irc_dictionary_find(nd_dict, nick))
        {
                sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
                           me.name, EmptyString(source_p->name) ? "*" : source_p->name, nick);
@@ -890,7 +890,7 @@ change_remote_nick(struct Client *client_p, struct Client *source_p,
        del_from_client_hash(source_p->name, source_p);
 
        /* invalidate nick delay when a remote client uses the nick.. */
-       if((nd = hash_find_nd(nick)))
+       if((nd = irc_dictionary_retrieve(nd_dict, nick)))
                free_nd_entry(nd);
 
        strcpy(source_p->name, nick);
@@ -1172,6 +1172,19 @@ register_client(struct Client *client_p, struct Client *server,
        const char *m;
        int flag;
 
+       if(server == NULL)
+       {
+               if((server = find_server(NULL, parv[7])) == NULL)
+               {
+                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                                            "Ghost killed: %s on invalid server %s",
+                                            nick, parv[7]);
+                       sendto_one(client_p, ":%s KILL %s :%s (Server doesn't exist)",
+                                       get_id(&me, client_p), nick, me.name);
+                       return 0;
+               }
+       }
+
        source_p = make_client(client_p);
        user = make_user(source_p);
        dlinkAddTail(source_p, &source_p->node, &global_client_list);
@@ -1212,7 +1225,7 @@ register_client(struct Client *client_p, struct Client *server,
        }
 
        /* remove any nd entries for this nick */
-       if((nd = hash_find_nd(nick)))
+       if((nd = irc_dictionary_retrieve(nd_dict, nick)))
                free_nd_entry(nd);
 
        add_to_client_hash(nick, source_p);
@@ -1265,20 +1278,7 @@ register_client(struct Client *client_p, struct Client *server,
        if(++Count.total > Count.max_tot)
                Count.max_tot = Count.total;
 
-       if(server == NULL)
-       {
-               if((source_p->servptr = find_server(NULL, server->name)) == NULL)
-               {
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                            "Ghost killed: %s on invalid server %s",
-                                            source_p->name, server->name);
-                       kill_client(client_p, source_p, "%s (Server doesn't exist)", me.name);
-                       source_p->flags |= FLAGS_KILLED;
-                       return exit_client(NULL, source_p, &me, "Ghosted Client");
-               }
-       }
-       else
-               source_p->servptr = server;
+       source_p->servptr = server;
 
        dlinkAdd(source_p, &source_p->lnode, &source_p->servptr->serv->users);