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), |
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 |
|
|
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() |
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 |
|
{ |
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 |
|
|
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 |
|
|
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) |
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 |
|
} |
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 |
|
|
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))", |
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 |
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)", |