X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/0d16e639f672a804cea43bd4b98684838b0d932d..7153d2c7997af1cda0f4c7e4203b45a57df2956b:/src/proto-p10.c diff --git a/src/proto-p10.c b/src/proto-p10.c index 39348bc..d611d98 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -1,7 +1,7 @@ /* proto-p10.c - IRC protocol output * Copyright 2000-2004 srvx Development Team * - * This file is part of srvx. + * This file is part of x3. * * srvx is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include "chanserv.h" #include "proto-common.c" /* Full commands. */ @@ -55,6 +56,7 @@ #define CMD_LIST "LIST" #define CMD_LUSERS "LUSERS" #define CMD_MAP "MAP" +#define CMD_MARK "MARK" #define CMD_MODE "MODE" #define CMD_MOTD "MOTD" #define CMD_NAMES "NAMES" @@ -123,6 +125,7 @@ #define TOK_EOB "EB" #define TOK_EOB_ACK "EA" #define TOK_ERROR "Y" +#define TOK_EXEMPT "EX" #define TOK_FAKEHOST "FA" #define TOK_GET "GET" #define TOK_GLINE "GL" @@ -139,6 +142,7 @@ #define TOK_LIST "LIST" #define TOK_LUSERS "LU" #define TOK_MAP "MAP" +#define TOK_MARK "MK" #define TOK_MODE "M" #define TOK_MOTD "MO" #define TOK_NAMES "E" @@ -234,6 +238,7 @@ #define P10_LIST TYPE(LIST) #define P10_LUSERS TYPE(LUSERS) #define P10_MAP TYPE(MAP) +#define P10_MARK TYPE(MARK) #define P10_MODE TYPE(MODE) #define P10_MOTD TYPE(MOTD) #define P10_NAMES TYPE(NAMES) @@ -281,6 +286,7 @@ #define P10_WHO TYPE(WHO) #define P10_WHOIS TYPE(WHOIS) #define P10_WHOWAS TYPE(WHOWAS) +#define P10_EXEMPT TYPE(EXEMPT) /* Servers claiming to have a boot or link time before PREHISTORY * trigger errors to the log. We hope no server has been running @@ -1143,8 +1149,10 @@ static CMD_FUNC(cmd_burst) if (ctype == 1) { if (bcheck == 0) { /* strip % char off start of very first ban */ - strncat(banlist, strtok(parm, "%"), sizeof(banlist) - 1 - strlen(banlist)); - strncat(banlist, " ", sizeof(banlist) - 1 - strlen(banlist)); + if (strlen(parm) > 1) { + strncat(banlist, strtok(parm, "%"), sizeof(banlist) - 1 - strlen(banlist)); + strncat(banlist, " ", sizeof(banlist) - 1 - strlen(banlist)); + } bcheck = 1; } else { strncat(banlist, parm, sizeof(banlist) - 1 - strlen(banlist)); @@ -1691,6 +1699,12 @@ init_parse(void) dict_insert(irc_func_dict, TOK_WALLOPS, cmd_dummy); dict_insert(irc_func_dict, CMD_WALLHOPS, cmd_dummy); dict_insert(irc_func_dict, TOK_WALLHOPS, cmd_dummy); + dict_insert(irc_func_dict, TOK_WALLUSERS, cmd_dummy); + /* Ignore dnsbl exemptions */ + dict_insert(irc_func_dict, TOK_EXEMPT, cmd_dummy); + dict_insert(irc_func_dict, TOK_MARK, cmd_dummy); + /* Ignore privs */ + dict_insert(irc_func_dict, TOK_PRIVS, cmd_dummy); /* We have reliable clock! Always! Wraaa! */ dict_insert(irc_func_dict, CMD_SETTIME, cmd_dummy); dict_insert(irc_func_dict, TOK_SETTIME, cmd_dummy); @@ -1951,6 +1965,7 @@ AddService(const char *nick, const char *modes, const char *desc, const char *ho if (!hostname) hostname = self->name; make_numeric(self, local_num, numeric); + /* TODO: Make these modes part of the conf file */ return AddUser(self, nick, nick, hostname, modes ? modes : "+oik", numeric, desc, now, "AAAAAA"); } @@ -2078,6 +2093,9 @@ DelUser(struct userNode* user, struct userNode *killer, int announce, const char /* mark them as dead, in case anybody cares */ user->dead = 1; + /* remove pending adduser commands */ + wipe_adduser_pending(NULL, user); + /* remove user from all channels */ while (user->channels.used > 0) DelChannelUser(user, user->channels.list[user->channels.used-1]->channel, false, 0); @@ -2236,6 +2254,8 @@ mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, un case 'Q': do_chan_mode(MODE_NOQUITMSGS); break; case 'T': do_chan_mode(MODE_NOAMSG); break; case 'O': do_chan_mode(MODE_OPERSONLY); break; + case 'Z': do_chan_mode(MODE_SSLONLY); break; + case 'L': do_chan_mode(MODE_HIDEMODE); break; case 'z': if (!(flags & MCP_REGISTERED)) { do_chan_mode(MODE_REGISTERED); @@ -2244,8 +2264,6 @@ mod_chanmode_parse(struct chanNode *channel, char **modes, unsigned int argc, un return NULL; } break; -// uncomment this when ssl is enabled on the network. -// case 'Z': do_chan_mode(MODE_SSLONLY); break; #undef do_chan_mode case 'l': if (add) { @@ -2413,8 +2431,8 @@ mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod DO_MODE_CHAR(NOAMSG, 'T'); DO_MODE_CHAR(OPERSONLY, 'O'); DO_MODE_CHAR(REGISTERED, 'z'); - // uncomment this for ssl support - //DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(HIDEMODE, 'L'); #undef DO_MODE_CHAR if (change->modes_clear & channel->modes & MODE_KEY) mod_chanmode_append(&chbuf, 'k', channel->key); @@ -2465,8 +2483,8 @@ mod_chanmode_announce(struct userNode *who, struct chanNode *channel, struct mod DO_MODE_CHAR(NOAMSG, 'T'); DO_MODE_CHAR(OPERSONLY, 'O'); DO_MODE_CHAR(REGISTERED, 'z'); - // uncomment this for ssl support - //DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(HIDEMODE, 'L'); #undef DO_MODE_CHAR if(change->modes_set & MODE_KEY) mod_chanmode_append(&chbuf, 'k', change->new_key); @@ -2534,8 +2552,8 @@ mod_chanmode_format(struct mod_chanmode *change, char *outbuff) DO_MODE_CHAR(NOAMSG, 'T'); DO_MODE_CHAR(OPERSONLY, 'O'); DO_MODE_CHAR(REGISTERED, 'z'); - // uncomment this for ssl support - //DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(HIDEMODE, 'L'); #undef DO_MODE_CHAR } if (change->modes_set) { @@ -2558,8 +2576,8 @@ mod_chanmode_format(struct mod_chanmode *change, char *outbuff) DO_MODE_CHAR(NOAMSG, 'T'); DO_MODE_CHAR(OPERSONLY, 'O'); DO_MODE_CHAR(REGISTERED, 'z'); - // uncomment this for ssl support - //DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(SSLONLY, 'Z'); + DO_MODE_CHAR(HIDEMODE, 'L'); #undef DO_MODE_CHAR switch (change->modes_set & (MODE_KEY|MODE_LIMIT)) { case MODE_KEY|MODE_LIMIT: @@ -2605,7 +2623,7 @@ clear_chanmode(struct chanNode *channel, const char *modes) case 'e': remove |= MODE_EXEMPT; break; case 'D': remove |= MODE_DELAYJOINS; break; case 'r': remove |= MODE_REGONLY; break; - case 'c': remove |= MODE_NOCOLORS; + case 'c': remove |= MODE_NOCOLORS; break; case 'C': remove |= MODE_NOCTCPS; break; case 'S': remove |= MODE_STRIPCOLOR; break; case 'M': remove |= MODE_MODUNREG; break; @@ -2614,6 +2632,8 @@ clear_chanmode(struct chanNode *channel, const char *modes) case 'T': remove |= MODE_NOAMSG; break; case 'O': remove |= MODE_OPERSONLY; break; case 'z': remove |= MODE_REGISTERED; break; + case 'Z': remove |= MODE_SSLONLY; break; + case 'L': remove |= MODE_HIDEMODE; break; } }