00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "services.h"
00015 #include "pseudo.h"
00016 #include "hybrid.h"
00017
00018 IRCDVar myIrcd[] = {
00019 {"HybridIRCd 7.*",
00020 "+o",
00021 "+o",
00022 "+o",
00023 NULL,
00024 "+aio",
00025 "+o",
00026 "+h",
00027 "+i",
00028 "+io",
00029 "+o",
00030 "+o",
00031 "+o",
00032 NULL,
00033 "+aio",
00034 "+o",
00035 "+h",
00036 "+i",
00037 "+io",
00038 "+",
00039 3,
00040 "-ailmnpst",
00041 "+o",
00042 0,
00043 0,
00044 0,
00045 NULL,
00046 NULL,
00047 NULL,
00048 NULL,
00049 NULL,
00050 NULL,
00051 NULL,
00052 NULL,
00053 NULL,
00054 NULL,
00055 1,
00056 1,
00057 0,
00058 1,
00059 3,
00060 1,
00061 1,
00062 1,
00063 0,
00064 0,
00065 0,
00066 0,
00067 0,
00068 0,
00069 0,
00070 0,
00071 0,
00072 0,
00073 0,
00074 0,
00075 0,
00076 0,
00077 0,
00078 0,
00079 0,
00080 0,
00081 0,
00082 CMODE_p,
00083 0,
00084 DEFAULT_MLOCK,
00085 0,
00086 0,
00087 0,
00088 0,
00089 0,
00090 0,
00091 0,
00092 NULL,
00093 0,
00094 1,
00095 0,
00096 0,
00097 0,
00098 0,
00099 0,
00100 0,
00101 0,
00102 NULL,
00103 0,
00104 0,
00105 0,
00106 NULL,
00107 0,
00108 0,
00109 }
00110 ,
00111 {NULL}
00112 };
00113
00114 IRCDCAPAB myIrcdcap[] = {
00115 {
00116 CAPAB_NOQUIT,
00117 0,
00118 0,
00119 0,
00120 0,
00121 CAPAB_ZIP,
00122 0,
00123 CAPAB_TS5,
00124 0,
00125 0,
00126 0,
00127 0,
00128 CAPAB_QS,
00129 CAPAB_UID,
00130 CAPAB_KNOCK,
00131 0,
00132 0,
00133 0,
00134 0,
00135 0,
00136 0,
00137 0,
00138 0,
00139 0,
00140 0,
00141 0,
00142 0,
00143 0,
00144 0, 0, 0}
00145 };
00146
00147
00148
00149 void hybrid_set_umode(User * user, int ac, char **av)
00150 {
00151 int add = 1;
00152 char *modes = av[0];
00153
00154 ac--;
00155
00156 if (debug)
00157 alog("debug: Changing mode for %s to %s", user->nick, modes);
00158
00159 while (*modes) {
00160
00161
00162
00163
00164 if (add)
00165 user->mode |= umodes[(int) *modes];
00166 else
00167 user->mode &= ~umodes[(int) *modes];
00168
00169 switch (*modes++) {
00170 case '+':
00171 add = 1;
00172 break;
00173 case '-':
00174 add = 0;
00175 break;
00176 case 'd':
00177 if (ac == 0) {
00178 alog("user: umode +d with no parameter (?) for user %s",
00179 user->nick);
00180 break;
00181 }
00182
00183 ac--;
00184 av++;
00185 user->svid = strtoul(*av, NULL, 0);
00186 break;
00187 case 'o':
00188 if (add) {
00189 opcnt++;
00190
00191 if (WallOper)
00192 anope_cmd_global(s_OperServ,
00193 "\2%s\2 is now an IRC operator.",
00194 user->nick);
00195 display_news(user, NEWS_OPER);
00196
00197 } else {
00198 opcnt--;
00199 }
00200 break;
00201 case 'r':
00202 if (add && !nick_identified(user)) {
00203 send_cmd(ServerName, "SVSMODE %s -r", user->nick);
00204 user->mode &= ~UMODE_r;
00205 }
00206 break;
00207
00208 }
00209 }
00210 }
00211
00212 unsigned long umodes[128] = {
00213 0, 0, 0,
00214 0, 0, 0,
00215 0, 0, 0,
00216 0, 0, 0,
00217 0, 0, 0,
00218 0, 0, 0,
00219 0, 0, 0,
00220 0, 0, 0,
00221 0, 0, 0,
00222 0, 0, 0,
00223 0, 0, 0,
00224 0, 0, 0,
00225 0, 0, 0,
00226 0, 0, 0,
00227 0, 0, 0,
00228 0, 0, 0,
00229 0, 0,
00230 0, 0,
00231 0, 0,
00232 0, 0,
00233 0, 0,
00234 0, 0,
00235 0, 0, 0,
00236 0, 0,
00237 0, 0, 0,
00238 0, 0, 0,
00239 0, 0, 0,
00240 0, 0, 0,
00241 0, 0, 0,
00242 0, 0, 0,
00243 0, 0, 0,
00244 0, 0, 0,
00245 0,
00246 0,
00247 0, 0, 0,
00248 0, 0, 0,
00249 UMODE_a, UMODE_b, UMODE_c,
00250 UMODE_d, 0, UMODE_f,
00251 UMODE_g, 0, UMODE_i,
00252 0, UMODE_k, UMODE_l,
00253 0, UMODE_n, UMODE_o,
00254 0, 0, UMODE_r,
00255 UMODE_s, 0, UMODE_u,
00256 0, UMODE_w, UMODE_x,
00257 UMODE_y,
00258 UMODE_z,
00259 0, 0, 0,
00260 0, 0
00261 };
00262
00263
00264 char myCsmodes[128] = {
00265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00266 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00267
00268 0,
00269 'a',
00270 0, 0, 0,
00271 'h',
00272 0, 0, 0, 0,
00273 0,
00274
00275 'v', 0, 0, 0, 0,
00276 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00277
00278 'o', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00279 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00280
00281 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
00283 };
00284
00285 CMMode myCmmodes[128] = {
00286 {NULL}, {NULL}, {NULL},
00287 {NULL}, {NULL}, {NULL},
00288 {NULL}, {NULL}, {NULL},
00289 {NULL}, {NULL}, {NULL},
00290 {NULL}, {NULL}, {NULL},
00291 {NULL}, {NULL}, {NULL},
00292 {NULL}, {NULL}, {NULL},
00293 {NULL}, {NULL}, {NULL},
00294 {NULL}, {NULL}, {NULL},
00295 {NULL}, {NULL}, {NULL},
00296 {NULL}, {NULL}, {NULL},
00297 {NULL}, {NULL}, {NULL},
00298 {NULL}, {NULL}, {NULL},
00299 {NULL}, {NULL}, {NULL},
00300 {NULL}, {NULL}, {NULL},
00301 {NULL}, {NULL}, {NULL},
00302 {NULL}, {NULL}, {NULL},
00303 {NULL}, {NULL}, {NULL},
00304 {NULL}, {NULL}, {NULL},
00305 {NULL}, {NULL}, {NULL},
00306 {NULL}, {NULL}, {NULL},
00307 {NULL}, {NULL}, {NULL},
00308 {NULL}, {NULL}, {NULL},
00309 {NULL}, {NULL}, {NULL},
00310 {NULL},
00311 {add_invite, del_invite},
00312 {NULL},
00313 {NULL}, {NULL}, {NULL},
00314 {NULL}, {NULL}, {NULL},
00315 {NULL}, {NULL}, {NULL},
00316 {NULL}, {NULL}, {NULL},
00317 {NULL}, {NULL}, {NULL},
00318 {NULL},
00319 {NULL}, {NULL},
00320 {NULL}, {NULL}, {NULL},
00321 {NULL},
00322 {NULL},
00323 {add_ban, del_ban},
00324 {NULL},
00325 {NULL},
00326 {add_exception, del_exception},
00327 {NULL},
00328 {NULL},
00329 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00330 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL},
00331 {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}, {NULL}
00332 };
00333
00334
00335 CBMode myCbmodes[128] = {
00336 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00337 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00338 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00339 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00340 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00341 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00342 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00343 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00344 {0},
00345 {0},
00346 {0},
00347 {0},
00348 {0},
00349 {0},
00350 {0},
00351 {0},
00352 {0},
00353 {0},
00354 {0},
00355 {0},
00356 {0},
00357 {0},
00358 {0},
00359 {0},
00360 {0},
00361 {0},
00362 {0},
00363 {0},
00364 {0},
00365 {0},
00366 {0},
00367 {0},
00368 {0},
00369 {0},
00370 {0},
00371 {0}, {0}, {0}, {0}, {0}, {0},
00372 {CMODE_a, 0, NULL, NULL},
00373 {0},
00374 {0},
00375 {0},
00376 {0},
00377 {0},
00378 {0},
00379 {0},
00380 {CMODE_i, 0, NULL, NULL},
00381 {0},
00382 {CMODE_k, 0, chan_set_key, cs_set_key},
00383 {CMODE_l, CBM_MINUS_NO_ARG, set_limit, cs_set_limit},
00384 {CMODE_m, 0, NULL, NULL},
00385 {CMODE_n, 0, NULL, NULL},
00386 {0},
00387 {CMODE_p, 0, NULL, NULL},
00388 {0},
00389 {0},
00390 {CMODE_s, 0, NULL, NULL},
00391 {CMODE_t, 0, NULL, NULL},
00392 {0},
00393 {0},
00394 {0},
00395 {0},
00396 {0},
00397 {0},
00398 {0}, {0}, {0}, {0}
00399 };
00400
00401 CBModeInfo myCbmodeinfos[] = {
00402 {'a', CMODE_a, 0, NULL, NULL},
00403 {'i', CMODE_i, 0, NULL, NULL},
00404 {'k', CMODE_k, 0, get_key, cs_get_key},
00405 {'l', CMODE_l, CBM_MINUS_NO_ARG, get_limit, cs_get_limit},
00406 {'m', CMODE_m, 0, NULL, NULL},
00407 {'n', CMODE_n, 0, NULL, NULL},
00408 {'p', CMODE_p, 0, NULL, NULL},
00409 {'s', CMODE_s, 0, NULL, NULL},
00410 {'t', CMODE_t, 0, NULL, NULL},
00411 {0}
00412 };
00413
00414
00415 CUMode myCumodes[128] = {
00416 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00417 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00418 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00419 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00420
00421 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00422 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00423 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00424 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00425
00426 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00427 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00428 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00429 {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0},
00430
00431 {0},
00432
00433 {0},
00434 {0},
00435 {0},
00436 {0},
00437 {0},
00438 {0},
00439 {0},
00440 {CUS_HALFOP, 0, check_valid_op},
00441 {0},
00442 {0},
00443 {0},
00444 {0},
00445 {0},
00446 {0},
00447 {CUS_OP, CUF_PROTECT_BOTSERV, check_valid_op},
00448 {0},
00449 {0},
00450 {0},
00451 {0},
00452 {0},
00453 {0},
00454 {CUS_VOICE, 0, NULL},
00455 {0},
00456 {0},
00457 {0},
00458 {0},
00459 {0}, {0}, {0}, {0}, {0}
00460 };
00461
00462
00463
00464 void hybrid_cmd_notice(char *source, char *dest, char *buf)
00465 {
00466 if (!buf) {
00467 return;
00468 }
00469
00470 if (NSDefFlags & NI_MSG) {
00471 hybrid_cmd_privmsg2(source, dest, buf);
00472 } else {
00473 send_cmd(source, "NOTICE %s :%s", dest, buf);
00474 }
00475 }
00476
00477 void hybrid_cmd_notice2(char *source, char *dest, char *msg)
00478 {
00479 send_cmd(source, "NOTICE %s :%s", dest, msg);
00480 }
00481
00482 void hybrid_cmd_privmsg(char *source, char *dest, char *buf)
00483 {
00484 if (!buf) {
00485 return;
00486 }
00487
00488 send_cmd(source, "PRIVMSG %s :%s", dest, buf);
00489 }
00490
00491 void hybrid_cmd_privmsg2(char *source, char *dest, char *msg)
00492 {
00493 send_cmd(source, "PRIVMSG %s :%s", dest, msg);
00494 }
00495
00496 void hybrid_cmd_serv_notice(char *source, char *dest, char *msg)
00497 {
00498 send_cmd(source, "NOTICE $$%s :%s", dest, msg);
00499 }
00500
00501 void hybrid_cmd_serv_privmsg(char *source, char *dest, char *msg)
00502 {
00503 send_cmd(source, "PRIVMSG $$%s :%s", dest, msg);
00504 }
00505
00506
00507 void hybrid_cmd_global(char *source, char *buf)
00508 {
00509 if (!buf) {
00510 return;
00511 }
00512
00513 send_cmd(source ? source : ServerName, "OPERWALL :%s", buf);
00514 }
00515
00516
00517 void hybrid_cmd_global_legacy(char *source, char *fmt)
00518 {
00519 send_cmd(source ? source : ServerName, "OPERWALL :%s", fmt);
00520 }
00521
00522 int anope_event_sjoin(char *source, int ac, char **av)
00523 {
00524 do_sjoin(source, ac, av);
00525 return MOD_CONT;
00526 }
00527
00528 int anope_event_nick(char *source, int ac, char **av)
00529 {
00530 if (ac != 2) {
00531 User *user = do_nick(source, av[0], av[4], av[5], av[6], av[7],
00532 strtoul(av[2], NULL, 10), 0, 0, NULL, NULL);
00533 if (user)
00534 anope_set_umode(user, 1, &av[3]);
00535 } else {
00536 do_nick(source, av[0], NULL, NULL, NULL, NULL,
00537 strtoul(av[1], NULL, 10), 0, 0, NULL, NULL);
00538 }
00539 return MOD_CONT;
00540 }
00541
00542 int anope_event_topic(char *source, int ac, char **av)
00543 {
00544 if (ac == 4) {
00545 do_topic(source, ac, av);
00546 } else {
00547 Channel *c = findchan(av[0]);
00548 time_t topic_time = time(NULL);
00549
00550 if (!c) {
00551 if (debug) {
00552 alog("debug: TOPIC %s for nonexistent channel %s",
00553 merge_args(ac - 1, av + 1), av[0]);
00554 }
00555 return MOD_CONT;
00556 }
00557
00558 if (check_topiclock(c, topic_time))
00559 return MOD_CONT;
00560
00561 if (c->topic) {
00562 free(c->topic);
00563 c->topic = NULL;
00564 }
00565 if (ac > 1 && *av[1])
00566 c->topic = sstrdup(av[1]);
00567
00568 strscpy(c->topic_setter, source, sizeof(c->topic_setter));
00569 c->topic_time = topic_time;
00570
00571 record_topic(av[0]);
00572
00573 if (ac > 1 && *av[1])
00574 send_event(EVENT_TOPIC_UPDATED, 2, av[0], av[1]);
00575 else
00576 send_event(EVENT_TOPIC_UPDATED, 2, av[0], "");
00577 }
00578 return MOD_CONT;
00579 }
00580
00581 int anope_event_tburst(char *source, int ac, char **av)
00582 {
00583 if (ac != 5)
00584 return MOD_CONT;
00585
00586 av[0] = av[1];
00587 av[1] = av[3];
00588 av[3] = av[4];
00589 do_topic(source, 4, av);
00590 return MOD_CONT;
00591 }
00592
00593 int anope_event_436(char *source, int ac, char **av)
00594 {
00595 if (ac < 1)
00596 return MOD_CONT;
00597
00598 m_nickcoll(av[0]);
00599 return MOD_CONT;
00600 }
00601
00602
00603
00604 void moduleAddIRCDMsgs(void) {
00605 Message *m;
00606
00607 updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-");
00608
00609 m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m);
00610 m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m);
00611 m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m);
00612 m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m);
00613 m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m);
00614 m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m);
00615 m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m);
00616 m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m);
00617 m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m);
00618 m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m);
00619 m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m);
00620 m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m);
00621 m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m);
00622 m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m);
00623 m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m);
00624 m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m);
00625 m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m);
00626 m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m);
00627 m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m);
00628 m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m);
00629 m = createMessage("TBURST", anope_event_tburst); addCoreMessage(IRCD,m);
00630 m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m);
00631 m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m);
00632 m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m);
00633 m = createMessage("AKILL", anope_event_null); addCoreMessage(IRCD,m);
00634 m = createMessage("GLOBOPS", anope_event_null); addCoreMessage(IRCD,m);
00635 m = createMessage("GNOTICE", anope_event_null); addCoreMessage(IRCD,m);
00636 m = createMessage("GOPER", anope_event_null); addCoreMessage(IRCD,m);
00637 m = createMessage("RAKILL", anope_event_null); addCoreMessage(IRCD,m);
00638 m = createMessage("SILENCE", anope_event_null); addCoreMessage(IRCD,m);
00639 m = createMessage("SVSKILL", anope_event_null); addCoreMessage(IRCD,m);
00640 m = createMessage("SVSMODE", anope_event_null); addCoreMessage(IRCD,m);
00641 m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m);
00642 m = createMessage("SVSNOOP", anope_event_null); addCoreMessage(IRCD,m);
00643 m = createMessage("SQLINE", anope_event_null); addCoreMessage(IRCD,m);
00644 m = createMessage("UNSQLINE", anope_event_null); addCoreMessage(IRCD,m);
00645 m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m);
00646 m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m);
00647 m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m);
00648
00649 m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m);
00650 m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m);
00651 }
00652
00653
00654
00655
00656 void hybrid_cmd_sqline(char *mask, char *reason)
00657 {
00658 if (!mask || !reason) {
00659 return;
00660 }
00661
00662 send_cmd(ServerName, "RESV * %s :%s", mask, reason);
00663 }
00664 void hybrid_cmd_unsgline(char *mask)
00665 {
00666 if (!mask) {
00667 return;
00668 }
00669
00670 send_cmd(ServerName, "UNXLINE * %s", mask);
00671 }
00672
00673 void hybrid_cmd_unszline(char *mask)
00674 {
00675
00676 }
00677 void hybrid_cmd_szline(char *mask, char *reason, char *whom)
00678 {
00679
00680 }
00681
00682 void hybrid_cmd_svsnoop(char *server, int set)
00683 {
00684
00685 }
00686
00687 void hybrid_cmd_svsadmin(char *server, int set)
00688 {
00689 hybrid_cmd_svsnoop(server, set);
00690 }
00691
00692 void hybrid_cmd_sgline(char *mask, char *reason)
00693 {
00694 if (!mask || !reason) {
00695 return;
00696 }
00697
00698 send_cmd(ServerName, "XLINE * %s 0 :%s", mask, reason);
00699 }
00700
00701 void hybrid_cmd_remove_akill(char *user, char *host)
00702 {
00703
00704 send_cmd(s_OperServ, "UNKLINE * %s %s", user, host);
00705 }
00706
00707 void hybrid_cmd_topic(char *whosets, char *chan, char *whosetit,
00708 char *topic, time_t when)
00709 {
00710 send_cmd(whosets, "TOPIC %s :%s", chan, topic);
00711 }
00712
00713 void hybrid_cmd_vhost_off(User * u)
00714 {
00715
00716 }
00717
00718 void hybrid_cmd_vhost_on(char *nick, char *vIdent, char *vhost)
00719 {
00720
00721 }
00722
00723 void hybrid_cmd_unsqline(char *user)
00724 {
00725 if (!user) {
00726 return;
00727 }
00728
00729 send_cmd(ServerName, "UNRESV * %s", user);
00730 }
00731
00732 void hybrid_cmd_join(char *user, char *channel, time_t chantime)
00733 {
00734 send_cmd(NULL, "SJOIN %ld %s + :%s", (long int) chantime, channel,
00735 user);
00736 }
00737
00738
00739
00740
00741
00742
00743
00744
00745
00746
00747 void hybrid_cmd_akill(char *user, char *host, char *who, time_t when,
00748 time_t expires, char *reason)
00749 {
00750 send_cmd(s_OperServ, "KLINE * %ld %s %s :%s",
00751 (long int) (expires - (long) time(NULL)), user, host, reason);
00752 }
00753
00754 void hybrid_cmd_svskill(char *source, char *user, char *buf)
00755 {
00756 if (!buf) {
00757 return;
00758 }
00759
00760 if (!source || !user) {
00761 return;
00762 }
00763
00764 send_cmd(source, "KILL %s :%s", user, buf);
00765 }
00766
00767
00768 void hybrid_cmd_svsmode(User * u, int ac, char **av)
00769 {
00770
00771 }
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781 void hybrid_cmd_svinfo()
00782 {
00783 send_cmd(NULL, "SVINFO 5 5 0 :%ld", (long int) time(NULL));
00784 }
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807 void hybrid_cmd_capab()
00808 {
00809 send_cmd(NULL,
00810 "CAPAB :QS EX CHW IE KLN GLN HOPS HUB AOPS KNOCK TBURST PARA");
00811 }
00812
00813
00814 void hybrid_cmd_pass(char *pass)
00815 {
00816 send_cmd(NULL, "PASS %s :TS", pass);
00817 }
00818
00819
00820 void hybrid_cmd_server(char *servname, int hop, char *descript)
00821 {
00822 send_cmd(NULL, "SERVER %s %d :%s", servname, hop, descript);
00823 }
00824 void hybrid_cmd_connect(int servernum)
00825 {
00826 me_server =
00827 new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL);
00828
00829 if (servernum == 1)
00830 hybrid_cmd_pass(RemotePassword);
00831 else if (servernum == 2)
00832 hybrid_cmd_pass(RemotePassword2);
00833 else if (servernum == 3)
00834 hybrid_cmd_pass(RemotePassword3);
00835
00836 hybrid_cmd_capab();
00837 hybrid_cmd_server(ServerName, 1, ServerDesc);
00838 hybrid_cmd_svinfo();
00839 }
00840
00841 void hybrid_cmd_svsinfo()
00842 {
00843
00844 }
00845
00846
00847
00848 void hybrid_cmd_bot_nick(char *nick, char *user, char *host, char *real,
00849 char *modes)
00850 {
00851 EnforceQlinedNick(nick, s_BotServ);
00852 send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s :%s", nick,
00853 (long int) time(NULL), modes, user, host, ServerName, real);
00854
00855 }
00856
00857 void hybrid_cmd_part(char *nick, char *chan, char *buf)
00858 {
00859 if (buf) {
00860 send_cmd(nick, "PART %s :%s", chan, buf);
00861 } else {
00862 send_cmd(nick, "PART %s", chan);
00863 }
00864 }
00865
00866 int anope_event_ping(char *source, int ac, char **av)
00867 {
00868 if (ac < 1)
00869 return MOD_CONT;
00870 hybrid_cmd_pong(ac > 1 ? av[1] : ServerName, av[0]);
00871 return MOD_CONT;
00872 }
00873
00874 int anope_event_away(char *source, int ac, char **av)
00875 {
00876 if (!source) {
00877 return MOD_CONT;
00878 }
00879 m_away(source, (ac ? av[0] : NULL));
00880 return MOD_CONT;
00881 }
00882
00883 int anope_event_kill(char *source, int ac, char **av)
00884 {
00885 if (ac != 2)
00886 return MOD_CONT;
00887
00888 m_kill(av[0], av[1]);
00889 return MOD_CONT;
00890 }
00891
00892 int anope_event_kick(char *source, int ac, char **av)
00893 {
00894 if (ac != 3)
00895 return MOD_CONT;
00896 do_kick(source, ac, av);
00897 return MOD_CONT;
00898 }
00899
00900 int anope_event_eob(char *source, int ac, char **av)
00901 {
00902 Server *s;
00903 s = findserver(servlist, source);
00904
00905
00906
00907
00908 if (!s && serv_uplink)
00909 s = serv_uplink;
00910 finish_sync(s, 1);
00911
00912 return MOD_CONT;
00913 }
00914
00915 void hybrid_cmd_eob()
00916 {
00917
00918 }
00919
00920
00921 int anope_event_join(char *source, int ac, char **av)
00922 {
00923 if (ac != 1)
00924 return MOD_CONT;
00925 do_join(source, ac, av);
00926 return MOD_CONT;
00927 }
00928
00929 int anope_event_motd(char *source, int ac, char **av)
00930 {
00931 if (!source) {
00932 return MOD_CONT;
00933 }
00934
00935 m_motd(source);
00936 return MOD_CONT;
00937 }
00938
00939 int anope_event_privmsg(char *source, int ac, char **av)
00940 {
00941 if (ac != 2)
00942 return MOD_CONT;
00943 m_privmsg(source, av[0], av[1]);
00944 return MOD_CONT;
00945 }
00946
00947 int anope_event_part(char *source, int ac, char **av)
00948 {
00949 if (ac < 1 || ac > 2)
00950 return MOD_CONT;
00951 do_part(source, ac, av);
00952 return MOD_CONT;
00953 }
00954
00955 int anope_event_whois(char *source, int ac, char **av)
00956 {
00957 if (source && ac >= 1) {
00958 m_whois(source, av[0]);
00959 }
00960 return MOD_CONT;
00961 }
00962
00963
00964 int anope_event_server(char *source, int ac, char **av)
00965 {
00966 if (!stricmp(av[1], "1")) {
00967 uplink = sstrdup(av[0]);
00968 }
00969 do_server(source, av[0], av[1], av[2], NULL);
00970 return MOD_CONT;
00971 }
00972
00973 int anope_event_squit(char *source, int ac, char **av)
00974 {
00975 if (ac != 2)
00976 return MOD_CONT;
00977 do_squit(source, ac, av);
00978 return MOD_CONT;
00979 }
00980
00981 int anope_event_quit(char *source, int ac, char **av)
00982 {
00983 if (ac != 1)
00984 return MOD_CONT;
00985 do_quit(source, ac, av);
00986 return MOD_CONT;
00987 }
00988
00989 void hybrid_cmd_372(char *source, char *msg)
00990 {
00991 send_cmd(ServerName, "372 %s :- %s", source, msg);
00992 }
00993
00994 void hybrid_cmd_372_error(char *source)
00995 {
00996 send_cmd(ServerName, "422 %s :- MOTD file not found! Please "
00997 "contact your IRC administrator.", source);
00998 }
00999
01000 void hybrid_cmd_375(char *source)
01001 {
01002 send_cmd(ServerName, "375 %s :- %s Message of the Day",
01003 source, ServerName);
01004 }
01005
01006 void hybrid_cmd_376(char *source)
01007 {
01008 send_cmd(ServerName, "376 %s :End of /MOTD command.", source);
01009 }
01010
01011
01012 void hybrid_cmd_391(char *source, char *timestr)
01013 {
01014 if (!timestr) {
01015 return;
01016 }
01017 send_cmd(NULL, "391 :%s %s :%s", source, ServerName, timestr);
01018 }
01019
01020
01021 void hybrid_cmd_250(char *buf)
01022 {
01023 if (!buf) {
01024 return;
01025 }
01026
01027 send_cmd(NULL, "250 %s", buf);
01028 }
01029
01030
01031 void hybrid_cmd_307(char *buf)
01032 {
01033 if (!buf) {
01034 return;
01035 }
01036
01037 send_cmd(ServerName, "307 %s", buf);
01038 }
01039
01040
01041 void hybrid_cmd_311(char *buf)
01042 {
01043 if (!buf) {
01044 return;
01045 }
01046
01047 send_cmd(ServerName, "311 %s", buf);
01048 }
01049
01050
01051 void hybrid_cmd_312(char *buf)
01052 {
01053 if (!buf) {
01054 return;
01055 }
01056
01057 send_cmd(ServerName, "312 %s", buf);
01058 }
01059
01060
01061 void hybrid_cmd_317(char *buf)
01062 {
01063 if (!buf) {
01064 return;
01065 }
01066
01067 send_cmd(ServerName, "317 %s", buf);
01068 }
01069
01070
01071 void