ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid-7.2/modules/core/m_nick.c
(Generate patch)

Comparing ircd-hybrid-7.2/modules/core/m_nick.c (file contents):
Revision 884 by michael, Wed Oct 24 21:51:21 2007 UTC vs.
Revision 885 by michael, Wed Oct 31 18:09:24 2007 UTC

# Line 106 | Line 106 | static void
106   mr_nick(struct Client *client_p, struct Client *source_p,
107          int parc, char *parv[])
108   {
109 <  struct Client *target_p, *uclient_p;
109 >  struct Client *target_p = NULL;
110    char nick[NICKLEN];
111 <  char *s;
112 <  dlink_node *ptr;
113 <  
111 >  char *s = NULL;
112 >
113    if (parc < 2 || EmptyString(parv[1]))
114    {
115      sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
# Line 119 | Line 118 | mr_nick(struct Client *client_p, struct
118    }
119  
120    /* Terminate the nick at the first ~ */
122  /* XXX - Is this still needed??      */
121    if ((s = strchr(parv[1], '~')) != NULL)
122      *s = '\0';
123  
# Line 144 | Line 142 | mr_nick(struct Client *client_p, struct
142    }
143  
144    if ((target_p = find_client(nick)) == NULL)
145 <  {
148 <    if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
149 <    {
150 <      /* We don't know anyone called nick, but our hub might */
151 <      DLINK_FOREACH(ptr, unknown_list.head)
152 <      {
153 <        uclient_p = ptr->data;
154 <
155 <        if (!strcmp(nick, uclient_p->llname))
156 <        {
157 <        
158 <          /* We're already waiting for a reply about this nick
159 <           * for someone else. */
160 <
161 <          sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick);
162 <          return;
163 <        }
164 <      }
165 <
166 <      /* Set their llname so we can find them later */
167 <      strcpy(source_p->llname, nick);
168 <
169 <      /* Ask the hub about their requested name */
170 <      sendto_one(uplink, ":%s NBURST %s %s !%s", me.name, nick,
171 <                 nick, nick);
172 <
173 <      /* wait for LLNICK */
174 <      return;
175 <    }
176 <    else
177 <    {
178 <      set_initial_nick(client_p, source_p, nick);
179 <      return;
180 <    }
181 <  }
145 >    set_initial_nick(client_p, source_p, nick);
146    else if (source_p == target_p)
183  {
147      strcpy(source_p->name, nick);
185    return;
186  }
148    else
188  {
149      sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick);
190  }
150   }
151  
152   /* m_nick()
# Line 200 | Line 159 | m_nick(struct Client *client_p, struct C
159         int parc, char *parv[])
160   {
161    char nick[NICKLEN];
162 <  struct Client *target_p;
162 >  struct Client *target_p = NULL;
163  
164    if (parc < 2 || EmptyString(parv[1]))
165    {
# Line 270 | Line 229 | m_nick(struct Client *client_p, struct C
229    }
230    else
231    {
232 <    if (!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
233 <    {
275 <      /* The uplink might know someone by this name already. */
276 <      sendto_one(uplink, ":%s NBURST %s %s %s",
277 <                 ID_or_name(&me, uplink), nick,
278 <                 nick, source_p->name);
279 <      return;
280 <    }
281 <    else
282 <    {
283 <      change_local_nick(client_p,source_p,nick);
284 <      return;
285 <    }
232 >    change_local_nick(client_p,source_p,nick);
233 >    return;
234    }
235   }
236  
# Line 460 | Line 408 | ms_uid(struct Client *client_p, struct C
408                           target_p->name, target_p->from->name,
409                           client_p->name);
410  
463    if (ServerInfo.hub && IsCapable(client_p, CAP_LL))
464      add_lazylinkclient(client_p, source_p);
465
411      kill_client_ll_serv_butone(NULL, target_p, "%s (ID collision)",
412                                 me.name);
413  
# Line 684 | Line 629 | nick_from_server(struct Client *client_p
629      source_p = make_client(client_p);
630      dlinkAdd(source_p, &source_p->node, &global_client_list);
631  
687    /* We don't need to introduce leafs clients back to them! */
688    if (ServerInfo.hub && IsCapable(client_p, CAP_LL))
689      add_lazylinkclient(client_p, source_p);
690
632      if (parc > 2)
633        source_p->hopcount = atoi(parv[2]);
634      if (newts)
# Line 745 | Line 686 | nick_from_server(struct Client *client_p
686                                   source_p->host, nick);
687  
688      add_history(source_p, 1);
689 <    sendto_server(client_p, source_p, NULL, CAP_TS6, NOCAPS, NOFLAGS,
689 >    sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
690                    ":%s NICK %s :%lu",
691                    ID(source_p), nick, (unsigned long)source_p->tsinfo);
692 <    sendto_server(client_p, source_p, NULL, NOCAPS, CAP_TS6, NOFLAGS,
692 >    sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
693                    ":%s NICK %s :%lu",
694                    parv[0], nick, (unsigned long)source_p->tsinfo);
695    }
# Line 778 | Line 719 | client_from_server(struct Client *client
719    source_p = make_client(client_p);
720    dlinkAdd(source_p, &source_p->node, &global_client_list);
721  
781  /* We don't need to introduce leafs clients back to them! */
782  if (ServerInfo.hub && IsCapable(client_p, CAP_LL))
783    add_lazylinkclient(client_p, source_p);
784
722    source_p->hopcount = atoi(parv[2]);
723    source_p->tsinfo = newts;
724  
# Line 829 | Line 766 | perform_nick_collides(struct Client *sou
766                             target_p->name, target_p->from->name,
767                             client_p->name);
768        
832      if (ServerInfo.hub && IsCapable(client_p,CAP_LL))
833        add_lazylinkclient(client_p, target_p);
834
769        /* if we have a UID, issue a kill for it */
770        if (uid)
771          sendto_one(client_p, ":%s KILL %s :%s (Nick collision (new))",
# Line 864 | Line 798 | perform_nick_collides(struct Client *sou
798          if (uid)
799            sendto_one(client_p, ":%s KILL %s :%s (Nick collision (new))",
800                       me.id, uid, me.name);
867
868        client_burst_if_needed(client_p, target_p);
801          return;
802        }
803        else
# Line 923 | Line 855 | perform_nick_collides(struct Client *sou
855                                    me.name);
856  
857        ServerStats->is_kill++;
926      /* If we got the message from a LL, ensure it gets the kill */
927      if (ServerInfo.hub && IsCapable(client_p,CAP_LL))
928        add_lazylinkclient(client_p, target_p);
858  
859        kill_client_ll_serv_butone(NULL, target_p,
860                                   "%s (Nick change collision)",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines