]>
Commit | Line | Data |
---|---|---|
c86edd1d Q |
1 | /* nickhandlers.c */ |
2 | ||
3 | #include "nick.h" | |
4 | #include "../lib/flags.h" | |
5 | #include "../lib/irc_string.h" | |
6 | #include "../lib/base64.h" | |
7 | #include "../irc/irc.h" | |
8 | #include "../irc/irc_config.h" | |
9 | #include "../core/error.h" | |
10 | #include "../core/hooks.h" | |
11 | #include "../lib/sstring.h" | |
12 | #include "../server/server.h" | |
13 | #include "../parser/parser.h" | |
14 | #include <stdlib.h> | |
15 | #include <string.h> | |
16 | ||
17 | /* | |
18 | * handlenickmsg: | |
19 | * Handle new nicks being introduced to the network. | |
20 | * Handle renames. | |
21 | */ | |
22 | ||
23 | int handlenickmsg(void *source, int cargc, char **cargv) { | |
24 | char *sender=(char *)source; | |
25 | time_t timestamp; | |
26 | nick *np,*np2; | |
27 | nick **nh; | |
28 | char *fakehost; | |
29 | char *accountts; | |
c153c0dc | 30 | char *accountflags; |
526e7c1d | 31 | struct irc_in_addr ipaddress; |
47657339 C |
32 | char *accountid; |
33 | unsigned long userid; | |
c86edd1d Q |
34 | |
35 | if (cargc==2) { /* rename */ | |
36 | /* Nyklon 1017697578 */ | |
37 | timestamp=strtol(cargv[1],NULL,10); | |
38 | np=getnickbynumericstr(sender); | |
39 | if (np==NULL) { | |
40 | Error("nick",ERR_ERROR,"Rename from non-existent sender %s",sender); | |
41 | return CMD_OK; | |
42 | } | |
43 | np2=getnickbynick(cargv[0]); | |
44 | if (np==np2) { | |
45 | /* The new and old nickname have the same hash, this means a rename to the same name in | |
46 | * different case, e.g. Flash -> flash. In this case the timestamp for the change should | |
47 | * match the existing timestamp, and we can bypass all the collision checking and hash fettling. */ | |
48 | if (np->timestamp!=timestamp) { | |
16739dbe | 49 | Error("nick",ERR_WARNING,"Rename to same nickname with different timestamp (%s(%jd) -> %s(%jd))", |
58a4da4a | 50 | np->nick,(intmax_t)np->timestamp,cargv[0], (intmax_t)timestamp); |
c86edd1d Q |
51 | np->timestamp=timestamp; |
52 | } | |
53 | strncpy(np->nick,cargv[0],NICKLEN); | |
54 | np->nick[NICKLEN]='\0'; | |
55 | triggerhook(HOOK_NICK_RENAME,np); | |
56 | return CMD_OK; | |
57 | } | |
58 | if (np2!=NULL) { | |
59 | /* Nick collision */ | |
60 | if (ircd_strcmp(np->ident,np2->ident) || (np->host!=np2->host)) { | |
61 | /* Different user@host */ | |
62 | if (np2->timestamp < timestamp) { | |
63 | /* The nick attempting to rename got killed. Guess we don't need to do the rename now :) */ | |
64 | deletenick(np); | |
65 | return CMD_OK; | |
66 | } else { | |
67 | /* The other nick got killed */ | |
68 | deletenick(np2); | |
69 | } | |
70 | } else { | |
71 | if (np2->timestamp < timestamp) { | |
72 | /* Same user@host: reverse logic. Whose idea was all this anyway? */ | |
73 | deletenick(np2); | |
74 | } else { | |
75 | deletenick(np); | |
76 | return CMD_OK; | |
77 | } | |
78 | } | |
79 | } | |
80 | /* OK, we've survived the collision hazard. Change timestamp and rename */ | |
81 | np->timestamp=timestamp; | |
82 | removenickfromhash(np); | |
83 | strncpy(np->nick,cargv[0],NICKLEN); | |
84 | np->nick[NICKLEN]='\0'; | |
85 | addnicktohash(np); | |
86 | triggerhook(HOOK_NICK_RENAME,np); | |
87 | } else if (cargc>=8) { /* new nick */ | |
88 | /* Jupiler 2 1016645147 ~Jupiler www.iglobal.be +ir moo [FUTURE CRAP HERE] DV74O] BNBd7 :Jupiler */ | |
89 | timestamp=strtol(cargv[2],NULL,10); | |
90 | np=getnickbynick(cargv[0]); | |
91 | if (np!=NULL) { | |
92 | /* Nick collision */ | |
93 | if (ircd_strcmp(np->ident,cargv[3]) || ircd_strcmp(np->host->name->content,cargv[4])) { | |
94 | /* Different user@host */ | |
95 | if (timestamp>np->timestamp) { | |
96 | /* New nick is newer. Ignore this nick message */ | |
97 | return CMD_OK; | |
98 | } else { | |
99 | /* New nick is older. Kill the imposter, and drop through */ | |
100 | deletenick(np); | |
101 | } | |
102 | } else { | |
103 | if (timestamp>np->timestamp) { | |
104 | /* Same user@host, newer timestamp: we're killing off a ghost */ | |
105 | deletenick(np); | |
106 | } else { | |
107 | /* This nick is the ghost, so ignore it */ | |
108 | return CMD_OK; | |
109 | } | |
110 | } | |
111 | } | |
112 | ||
113 | nh=gethandlebynumeric(numerictolong(cargv[cargc-2],5)); | |
114 | if (!nh) { | |
115 | /* This isn't a valid numeric */ | |
116 | Error("nick",ERR_WARNING,"Received NICK with invalid numeric %s from %s.",cargv[cargc-2],sender); | |
117 | return CMD_ERROR; | |
118 | } | |
1a38afd3 P |
119 | |
120 | base64toip(cargv[cargc-3], &ipaddress); | |
121 | if (!irc_in_addr_valid(&ipaddress)) { | |
122 | Error("nick",ERR_ERROR,"Received NICK with invalid ipaddress for %s from %s.",cargv[0],sender); | |
123 | return CMD_ERROR; | |
124 | } | |
125 | ||
c86edd1d Q |
126 | /* At this stage the nick is cleared to proceed */ |
127 | np=newnick(); | |
128 | strncpy(np->nick,cargv[0],NICKLEN); | |
129 | np->nick[NICKLEN]='\0'; | |
130 | np->numeric=numerictolong(cargv[cargc-2],5); | |
131 | strncpy(np->ident,cargv[3],USERLEN); | |
132 | np->ident[USERLEN]='\0'; | |
133 | np->host=findorcreatehost(cargv[4]); | |
134 | np->realname=findorcreaterealname(cargv[cargc-1]); | |
135 | np->nextbyhost=np->host->nicks; | |
136 | np->host->nicks=np; | |
137 | np->nextbyrealname=np->realname->nicks; | |
138 | np->realname->nicks=np; | |
139 | np->timestamp=timestamp; | |
526e7c1d P |
140 | |
141 | base64toip(cargv[cargc-3], &ipaddress); | |
071d403d | 142 | np->ipnode = refnode(iptree, &ipaddress, PATRICIA_MAXBITS); |
96644df6 | 143 | node_increment_usercount(np->ipnode); |
526e7c1d | 144 | |
c86edd1d Q |
145 | np->shident=NULL; |
146 | np->sethost=NULL; | |
843184e3 | 147 | np->opername=NULL; |
c86edd1d Q |
148 | np->umodes=0; |
149 | np->marker=0; | |
150 | memset(np->exts, 0, MAXNICKEXTS * sizeof(void *)); | |
3404a8f0 | 151 | np->authname=NULLAUTHNAME; |
47657339 | 152 | np->auth=NULL; |
c4ffdb9b | 153 | np->accountts=0; |
c86edd1d | 154 | if(cargc>=9) { |
843184e3 CP |
155 | int sethostarg = 6, opernamearg = 6, accountarg = 6; |
156 | ||
c86edd1d | 157 | setflags(&(np->umodes),UMODE_ALL,cargv[5],umodeflags,REJECT_NONE); |
843184e3 CP |
158 | |
159 | if(IsOper(np) && (serverlist[myhub].flags & SMODE_OPERNAME)) { | |
160 | accountarg++; | |
161 | sethostarg++; | |
162 | ||
163 | np->opername=getsstring(cargv[opernamearg],ACCOUNTLEN); | |
164 | } | |
165 | ||
c86edd1d | 166 | if (IsAccount(np)) { |
843184e3 CP |
167 | sethostarg++; |
168 | ||
169 | if ((accountts=strchr(cargv[accountarg],':'))) { | |
3404a8f0 | 170 | userid=0; |
c86edd1d | 171 | *accountts++='\0'; |
3294b10b | 172 | np->accountts=strtoul(accountts,&accountid,10); |
47657339 | 173 | if(accountid) { |
c153c0dc | 174 | userid=strtoul(accountid + 1,&accountflags,10); |
3294b10b | 175 | if(userid) { |
843184e3 | 176 | np->auth=findorcreateauthname(userid, cargv[accountarg]); |
3294b10b | 177 | np->authname=np->auth->name; |
47657339 C |
178 | np->auth->usercount++; |
179 | np->nextbyauthname=np->auth->nicks; | |
180 | np->auth->nicks=np; | |
0b0fb773 | 181 | if(accountflags) |
92acf9ae | 182 | np->auth->flags=strtoull(accountflags + 1,NULL,10); |
47657339 | 183 | } |
3404a8f0 CP |
184 | } |
185 | if(!userid) { | |
3294b10b CP |
186 | np->authname=malloc(strlen(cargv[accountarg]) + 1); |
187 | strcpy(np->authname,cargv[accountarg]); | |
47657339 | 188 | } |
c86edd1d | 189 | } |
c86edd1d | 190 | } |
843184e3 | 191 | if (IsSetHost(np) && (fakehost=strchr(cargv[sethostarg],'@'))) { |
c86edd1d Q |
192 | /* valid sethost */ |
193 | *fakehost++='\0'; | |
843184e3 | 194 | np->shident=getsstring(cargv[sethostarg],USERLEN); |
c86edd1d Q |
195 | np->sethost=getsstring(fakehost,HOSTLEN); |
196 | } | |
197 | } | |
198 | ||
199 | /* Place this nick in the server nick table. Note that nh is valid from the numeric check above */ | |
200 | if (*nh) { | |
201 | /* There was a nick there already -- we have a masked numeric collision | |
202 | * This shouldn't happen, but if it does the newer nick takes precedence | |
203 | * (the two nicks are from the same server, and if the server has reissued | |
204 | * the masked numeric it must believe the old user no longer exists). | |
205 | */ | |
206 | Error("nick",ERR_ERROR,"Masked numeric collision for %s [%s vs %s]",cargv[0],cargv[cargc-2],longtonumeric((*nh)->numeric,5)); | |
207 | deletenick(*nh); | |
208 | } | |
209 | *nh=np; | |
210 | ||
211 | /* And the nick hash table */ | |
212 | addnicktohash(np); | |
213 | ||
214 | /* Trigger the hook */ | |
215 | triggerhook(HOOK_NICK_NEWNICK,np); | |
216 | } else { | |
217 | Error("nick",ERR_WARNING,"Nick message with weird number of parameters (%d)",cargc); | |
218 | } | |
219 | ||
220 | return CMD_OK; | |
221 | } | |
222 | ||
223 | int handlequitmsg(void *source, int cargc, char **cargv) { | |
224 | nick *np; | |
225 | void *harg[2]; | |
226 | ||
85c382d3 | 227 | if (cargc>0) { |
228 | harg[1]=(void *)cargv[0]; | |
c86edd1d Q |
229 | } else { |
230 | harg[1]=""; | |
231 | } | |
232 | ||
233 | np=getnickbynumericstr((char *)source); | |
234 | if (np) { | |
235 | harg[0]=(void *)np; | |
236 | triggerhook(HOOK_NICK_QUIT, harg); | |
237 | deletenick(np); | |
238 | } else { | |
239 | Error("nick",ERR_WARNING,"Quit from non-existant numeric %s",(char *)source); | |
240 | } | |
241 | return CMD_OK; | |
242 | } | |
243 | ||
244 | int handlekillmsg(void *source, int cargc, char **cargv) { | |
245 | nick *np; | |
acd438c7 | 246 | void *harg[2]; |
e3073692 CP |
247 | #warning Fix me to use source |
248 | ||
c86edd1d Q |
249 | if (cargc<1) { |
250 | Error("nick",ERR_WARNING,"Kill message with too few parameters"); | |
251 | return CMD_ERROR; | |
252 | } | |
acd438c7 CP |
253 | |
254 | if (cargc>1) { | |
255 | harg[1]=(void *)cargv[1]; | |
256 | } else { | |
257 | harg[1]=""; | |
258 | } | |
259 | ||
c86edd1d Q |
260 | np=getnickbynumericstr(cargv[0]); |
261 | if (np) { | |
acd438c7 CP |
262 | harg[0]=(void *)np; |
263 | triggerhook(HOOK_NICK_KILL, harg); | |
c86edd1d Q |
264 | deletenick(np); |
265 | } else { | |
266 | Error("nick",ERR_WARNING,"Kill for non-existant numeric %s",cargv[0]); | |
267 | } | |
268 | return CMD_OK; | |
269 | } | |
270 | ||
271 | int handleusermodemsg(void *source, int cargc, char **cargv) { | |
272 | nick *np; | |
273 | flag_t oldflags; | |
274 | char *fakehost; | |
275 | ||
276 | if (cargc<2) { | |
277 | Error("nick",ERR_WARNING,"Mode message with too few parameters"); | |
278 | return CMD_LAST; /* With <2 params the channels module won't want it either */ | |
279 | } | |
280 | ||
281 | if (cargv[0][0]=='#') { | |
282 | /* Channel mode change, we don't care. | |
283 | * We don't bother checking for other channel types here, since & channel mode | |
284 | * changes aren't broadcast and + channels don't have mode changes :) */ | |
285 | return CMD_OK; | |
286 | } | |
287 | ||
288 | np=getnickbynumericstr((char *)source); | |
289 | if (np!=NULL) { | |
290 | if (ircd_strcmp(cargv[0],np->nick)) { | |
291 | Error("nick",ERR_WARNING,"Attempted mode change on user %s by %s",cargv[0],np->nick); | |
292 | return CMD_OK; | |
293 | } | |
294 | oldflags=np->umodes; | |
295 | setflags(&(np->umodes),UMODE_ALL,cargv[1],umodeflags,REJECT_NONE); | |
843184e3 CP |
296 | |
297 | if (strchr(cargv[1],'o')) { /* o always comes on its own when being set */ | |
298 | if(serverlist[myhub].flags & SMODE_OPERNAME) { | |
299 | if((np->umodes & UMODE_OPER)) { | |
300 | np->opername = getsstring(cargv[2], ACCOUNTLEN); | |
301 | } else { | |
302 | freesstring(np->opername); | |
1a0e3977 | 303 | np->opername = NULL; |
843184e3 CP |
304 | } |
305 | } | |
306 | if((np->umodes ^ oldflags) & UMODE_OPER) | |
307 | triggerhook(HOOK_NICK_MODEOPER,np); | |
308 | } | |
c86edd1d Q |
309 | if (strchr(cargv[1],'h')) { /* Have to allow +h twice.. */ |
310 | /* +-h: just the freesstring() calls for the -h case */ | |
311 | freesstring(np->shident); /* freesstring(NULL) is OK */ | |
312 | freesstring(np->sethost); | |
313 | np->shident=NULL; | |
314 | np->sethost=NULL; | |
315 | if (IsSetHost(np) && cargc>2) { /* +h and mask received */ | |
316 | if ((fakehost=strchr(cargv[2],'@'))) { | |
317 | /* user@host change */ | |
318 | *fakehost++='\0'; | |
319 | np->shident=getsstring(cargv[2],USERLEN); | |
320 | np->sethost=getsstring(fakehost,HOSTLEN); | |
321 | } else { | |
322 | np->sethost=getsstring(cargv[2],HOSTLEN); | |
323 | } | |
324 | } | |
325 | triggerhook(HOOK_NICK_SETHOST, (void *)np); | |
326 | } | |
327 | } else { | |
328 | Error("nick",ERR_WARNING,"Usermode change by unknown user %s",(char *)source); | |
329 | } | |
330 | return CMD_OK; | |
331 | } | |
332 | ||
333 | int handlewhoismsg(void *source, int cargc, char **cargv) { | |
334 | nick *sender,*target; | |
335 | nick *nicks[2]; | |
336 | ||
337 | if (cargc<2) | |
338 | return CMD_OK; | |
339 | ||
340 | if (strncmp(cargv[0],mynumeric->content,2)) { | |
341 | return CMD_OK; | |
342 | } | |
343 | ||
344 | /* Find the sender... */ | |
345 | if ((sender=getnickbynumericstr((char *)source))==NULL) { | |
346 | Error("localuser",ERR_WARNING,"WHOIS message from non existent numeric %s",(char *)source); | |
347 | return CMD_OK; | |
348 | } | |
349 | ||
350 | /* :hub.splidge.netsplit.net 311 moo splidge splidge ground.stbarnab.as * :splidge | |
351 | :hub.splidge.netsplit.net 312 moo splidge splidge.netsplit.net :splidge's netsplit leaf | |
352 | :hub.splidge.netsplit.net 313 moo splidge :is an IRC Operator | |
353 | :hub.splidge.netsplit.net 318 moo splidge :End of /WHOIS list. | |
354 | */ | |
355 | ||
356 | /* And the target... */ | |
357 | if ((target=getnickbynick(cargv[1]))==NULL) { | |
358 | irc_send(":%s 401 %s %s :No such nick",myserver->content,sender->nick,cargv[1]); | |
359 | } else { | |
360 | irc_send(":%s 311 %s %s %s %s * :%s",myserver->content,sender->nick,target->nick,target->ident, | |
361 | target->host->name->content, target->realname->name->content); | |
362 | nicks[0]=sender; nicks[1]=target; | |
363 | triggerhook(HOOK_NICK_WHOISCHANNELS,nicks); | |
364 | if (IsOper(sender) || !HIS_SERVER ) { | |
365 | irc_send(":%s 312 %s %s %s :%s",myserver->content,sender->nick,target->nick, | |
366 | serverlist[homeserver(target->numeric)].name->content, | |
367 | serverlist[homeserver(target->numeric)].description->content); | |
368 | } else { | |
369 | irc_send(":%s 312 %s %s " HIS_SERVERNAME " :" HIS_SERVERDESC,myserver->content,sender->nick,target->nick); | |
370 | } | |
371 | if (IsOper(target)) { | |
372 | irc_send(":%s 313 %s %s :is an IRC Operator",myserver->content,sender->nick,target->nick); | |
373 | } | |
374 | if (IsAccount(target)) { | |
109ba422 | 375 | irc_send(":%s 330 %s %s %s :is authed as",myserver->content,sender->nick,target->nick,target->authname); |
c86edd1d | 376 | } |
109ba422 | 377 | if (homeserver(target->numeric)==mylongnum && !IsService(target) && !IsHideIdle(target)) { |
c86edd1d | 378 | irc_send(":%s 317 %s %s %ld %ld :seconds idle, signon time",myserver->content,sender->nick,target->nick, |
80300a20 | 379 | (getnettime() - target->timestamp) % (((target->numeric + target->timestamp) % 983) + 7),target->timestamp); |
c86edd1d Q |
380 | } |
381 | } | |
382 | ||
383 | irc_send(":%s 318 %s %s :End of /WHOIS list.",myserver->content,sender->nick,cargv[1]); | |
384 | return CMD_OK; | |
385 | } | |
386 | ||
387 | int handleaccountmsg(void *source, int cargc, char **cargv) { | |
388 | nick *target; | |
47657339 | 389 | unsigned long userid; |
c4ffdb9b | 390 | time_t accountts; |
92acf9ae | 391 | u_int64_t accountflags, oldflags; |
c4ffdb9b CP |
392 | |
393 | if (cargc<4) { | |
c86edd1d Q |
394 | return CMD_OK; |
395 | } | |
396 | ||
397 | if ((target=getnickbynumericstr(cargv[0]))==NULL) { | |
398 | return CMD_OK; | |
399 | } | |
400 | ||
c4ffdb9b CP |
401 | accountts=strtoul(cargv[2],NULL,10); |
402 | userid=strtoul(cargv[3],NULL,10); | |
3294b10b | 403 | if(cargc>=5) |
92acf9ae | 404 | accountflags=strtoull(cargv[4],NULL,10); |
c4ffdb9b CP |
405 | |
406 | /* allow user flags to change if all fields match */ | |
c86edd1d | 407 | if (IsAccount(target)) { |
c4ffdb9b CP |
408 | void *arg[2]; |
409 | ||
3294b10b | 410 | if (!target->auth || strcmp(target->auth->name,cargv[1]) || (target->auth->userid != userid) || (target->accountts != accountts)) { |
c4ffdb9b CP |
411 | return CMD_OK; |
412 | } | |
413 | ||
92acf9ae CP |
414 | oldflags = target->auth->flags; |
415 | arg[0] = target->auth; | |
416 | arg[1] = &oldflags; | |
c4ffdb9b CP |
417 | |
418 | if (cargc>=5) | |
419 | target->auth->flags=accountflags; | |
420 | ||
421 | triggerhook(HOOK_AUTH_FLAGSUPDATED, (void *)arg); | |
422 | ||
c86edd1d Q |
423 | return CMD_OK; |
424 | } | |
425 | ||
426 | SetAccount(target); | |
c4ffdb9b CP |
427 | target->accountts=accountts; |
428 | ||
429 | if(!userid) { | |
47657339 | 430 | target->auth=NULL; |
3294b10b CP |
431 | target->authname=malloc(strlen(cargv[1]) + 1); |
432 | strcpy(target->authname,cargv[1]); | |
c4ffdb9b | 433 | } else { |
5bfb1d14 | 434 | target->auth=findorcreateauthname(userid, cargv[1]); |
c4ffdb9b | 435 | target->auth->usercount++; |
3294b10b | 436 | target->authname=target->auth->name; |
c4ffdb9b CP |
437 | target->nextbyauthname = target->auth->nicks; |
438 | target->auth->nicks = target; | |
439 | if (cargc>=5) | |
440 | target->auth->flags=accountflags; | |
47657339 | 441 | } |
c4ffdb9b | 442 | |
c86edd1d | 443 | triggerhook(HOOK_NICK_ACCOUNT, (void *)target); |
526e7c1d | 444 | |
c86edd1d Q |
445 | return CMD_OK; |
446 | } | |
447 | ||
448 | int handlestatsmsg(void *source, int cargc, char **cargv) { | |
449 | int sourceserver; | |
450 | char *sender=(char *)source; | |
451 | char *replytarget; | |
452 | char *fromstring; | |
453 | nick *np; | |
454 | ||
455 | if (cargc<2) { | |
456 | Error("nick",ERR_WARNING,"STATS request without enough parameters!"); | |
457 | return CMD_OK; | |
458 | } | |
459 | ||
460 | if (strlen(sender)==5) { | |
461 | /* client */ | |
462 | np=getnickbynumericstr(sender); | |
463 | if (!np) { | |
464 | Error("nick",ERR_WARNING,"STATS request from unknown client %s",sender); | |
465 | return CMD_OK; | |
466 | } | |
467 | replytarget=np->nick; | |
468 | } else { | |
469 | Error("nick",ERR_WARNING,"STATS request from odd source %s",sender); | |
470 | return CMD_OK; | |
471 | } | |
472 | ||
473 | /* Reply to stats for ANY server.. including any we are juping */ | |
474 | sourceserver=numerictolong(cargv[1],2); | |
475 | if (serverlist[sourceserver].maxusernum==0) { | |
476 | Error("nick",ERR_WARNING,"Stats request for bad server %s",cargv[1]); | |
477 | return CMD_OK; | |
478 | } | |
479 | fromstring=serverlist[sourceserver].name->content; | |
480 | ||
481 | switch(cargv[0][0]) { | |
482 | case 'u': | |
483 | irc_send(":%s 242 %s :Server Up %s",fromstring,replytarget, | |
484 | longtoduration(time(NULL)-starttime, 0)); | |
485 | irc_send(":%s 250 %s :Highest connection count: 10 (9 clients)",fromstring,replytarget); | |
486 | break; | |
487 | ||
488 | case 'P': | |
489 | irc_send(":%s 217 %s P none 0 :0x2000",fromstring,replytarget); | |
490 | break; | |
491 | ||
492 | } | |
493 | ||
494 | irc_send(":%s 219 %s %c :End of /STATS report",fromstring,replytarget,cargv[0][0]); | |
495 | ||
496 | return CMD_OK; | |
497 | } | |
6885ae9c CP |
498 | |
499 | int handleprivmsg(void *source, int cargc, char **cargv) { | |
500 | nick *sender; | |
501 | char *message; | |
502 | void *args[3]; | |
503 | ||
504 | if (cargc<2) | |
505 | return CMD_OK; | |
506 | ||
507 | if (cargv[0][0]!='$') | |
508 | return CMD_OK; | |
509 | ||
510 | sender=getnickbynumericstr((char *)source); | |
511 | ||
512 | if (!match2strings(cargv[0] + 1,myserver->content)) | |
513 | return CMD_OK; | |
514 | ||
515 | message=cargv[0]; | |
516 | ||
517 | args[0]=sender; | |
518 | args[1]=cargv[0]; | |
519 | args[2]=cargv[1]; | |
520 | ||
521 | triggerhook(HOOK_NICK_MASKPRIVMSG, (void *)args); | |
522 | ||
523 | return CMD_OK; | |
524 | } | |
525 |