[X2serv-cvs] [CVS] Module x3: Change committed
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2005-05-06 00:31:15
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-06 00:31:02 UTC Modified files: ChangeLog.X3 UPGRADE src/chanserv.c src/chanserv.help src/modcmd.c src/modcmd.help src/opserv.help Log message: changed addban to addlamer, added rebindall command ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.28 x3/ChangeLog.X3:1.29 --- x3/ChangeLog.X3:1.28 Wed May 4 20:19:09 2005 +++ x3/ChangeLog.X3 Thu May 5 17:30:51 2005 @@ -3,6 +3,23 @@ 2005-05-04 Alex Schumann <ru...@af...> + * src/modcmd.c: added a 'rebindall' command to assist with + upgrades and changes which change command bindings. + + * src/modcmd.help: modified help to reflect above + + * src/opserv.help: modified help to reflect above + + * src/chanserv.c: changed addban, addtimedban, delban, bans etc + to addlamer, dellamer, addtimedlamer, lamers to reduce confusion + between channel bans (+b) and x3 remembered bans (lamers) + + * src/chanserv.help: modified help to reflect above + + * UPGRADE: added use of rebindall to upgrade instructions + +2005-05-04 Alex Schumann <ru...@af...> + * src/chanserv.c: added an 'adduser pending' feature, where if someone isn't authed x3 will ask them to /auth or register, and then automatically finish adding them to the channel when they do. @@ -167,5 +184,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.28 $" +#define CVS_VERSION "$Revision: 1.29 $" Index: x3/UPGRADE diff -u x3/UPGRADE:1.1 x3/UPGRADE:1.2 --- x3/UPGRADE:1.1 Tue May 3 23:30:29 2005 +++ x3/UPGRADE Thu May 5 17:30:51 2005 @@ -10,15 +10,38 @@ * you can change from srvx.db to x3.db here also (dont forget to rename the file) Run all of the steps below -As of CVS version 1.24: - bind chanserv 'uset autoop' and 'set voice' (see note below). - +***************************** NOTE about command bindings: -You may do: 'bind x3 * *chanserv.*' to re-bind ALL builtin commands on chanserv. This -is the simplest approach and probably a good idea to run for each module (chanserv, -opserv, nickserv, modcmd, etc) after upgrading or changing some features (such as email). +***************************** +From srvx to x3, and within versions of x3, some commands have changed. When you upgrade +your .db file may not have command bindings for new command names. I have added a command +to help make solving this easy. +If you don't have the 'rebindall' command bound, first bind it: + /msg O3 bind o3 * *modcmd.* +Then, after any upgrade, or after adding modules, or changing command effecting settings +such as 'email', you can simply run: + /msg O3 rebindall +to ensure you have all the latest commands bound on all services. + +You may do: 'bind nick * *module.*' to re-bind ALL builtin commands on a givin module, +(chanserv, opserv, nickserv, modcmd, etc) if you prefer to update them individually +(if you unbind some default commands, and want them to stay unbound). Alternatively you can edit the .db by hand or using the 'bind' command on irc. -IMPORTANT: You will need to shut down x3 gracefully (using the die or restart commands) +NOTE: You will need to shut down x3 gracefully (using the die or restart commands) after binding in order for 'set' and 'uset' subcommand changes to function properly since -the listing is cached. +the listings are cached. + +********************************************* +*** Steps needed, by version: +*** note, binding can be taken care of +*** according to the note above. +********************************************* +As of CVS version 1.24: + bind chanserv commands: uset autoop, and set voice + +As of CVS version 1.29: + bind chanserv commands: addlamer, dellamer, addtimedlamer, lamers, and llist + bind opserv commands: rebindall + + Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.26 x3/src/chanserv.c:1.27 --- x3/src/chanserv.c:1.26 Wed May 4 17:14:56 2005 +++ x3/src/chanserv.c Thu May 5 17:30:51 2005 @@ -99,7 +99,7 @@ #define KEY_FLAGS "flags" #define KEY_OPTIONS "options" #define KEY_USERS "users" -#define KEY_BANS "bans" +#define KEY_BANS "bans" /* for lamers */ #define KEY_MAX "max" #define KEY_NOTES "notes" #define KEY_TOPIC_MASK "topic_mask" @@ -171,7 +171,7 @@ { "CSMSG_NO_CHAN_USER", "%s lacks access to $b%s$b." }, { "CSMSG_NO_ACCESS", "You lack sufficient access to use this command." }, { "CSMSG_NOT_REGISTERED", "$b%s$b has not been registered with $b$C$b." }, - { "CSMSG_MAXIMUM_BANS", "This channel has reached the ban count limit of $b%d$b." }, + { "CSMSG_MAXIMUM_LAMERS", "This channel has reached the lamer count limit of $b%d$b." }, { "CSMSG_MAXIMUM_USERS", "This channel has reached the user count limit of $b%d$b." }, { "CSMSG_ILLEGAL_CHANNEL", "$b%s$b is an illegal channel, and cannot be registered." }, { "CSMSG_GODMODE_UP", "You may not use $b%s$b to op yourself unless you are on the user list. Use the $bop$b command instead." }, @@ -210,21 +210,22 @@ { "CSMSG_OWNERSHIP_GIVEN", "Ownership of $b%s$b has been transferred to account $b%s$b." }, /* Ban management */ - { "CSMSG_BAN_ADDED", "Permanently banned $b%s$b from %s." }, - { "CSMSG_TIMED_BAN_ADDED", "Banned $b%s$b from %s for %s." }, + { "CSMSG_LAMER_ADDED", "Added $b%s$b to %s LAMERs." }, + { "CSMSG_TIMED_LAMER_ADDED", "LAMERed $b%s$b on %s for %s." }, { "CSMSG_KICK_BAN_DONE", "Kickbanned $b%s$b from %s." }, { "CSMSG_BAN_DONE", "Banned $b%s$b from %s." }, - { "CSMSG_REASON_CHANGE", "Reason for ban $b%s$b changed." }, - { "CSMSG_BAN_EXTENDED", "Extended ban for $b%s$b expires in %s." }, - { "CSMSG_BAN_REMOVED", "Matching ban(s) for $b%s$b removed." }, - { "CSMSG_TRIMMED_BANS", "Trimmed $b%d bans$b from the %s ban list that were inactive for at least %s." }, + { "CSMSG_REASON_CHANGE", "Reason for LAMER $b%s$b changed." }, + { "CSMSG_LAMER_EXTENDED", "Extended LAMER for $b%s$b, now expires in %s." }, + { "CSMSG_BAN_REMOVED", "Matching ban(s) and LAMER(s) in $b%s$b were removed." }, + { "CSMSG_TRIMMED_LAMERS", "Trimmed $b%d LAMERs$b from the %s LAMER list that were inactive for at least %s." }, { "CSMSG_REDUNDANT_BAN", "$b%s$b is already banned in %s." }, + { "CSMSG_REDUNDANT_LAMER", "$b%s$b is already LAMER'd in %s." }, { "CSMSG_DURATION_TOO_LOW", "Timed bans must last for at least 15 seconds." }, { "CSMSG_DURATION_TOO_HIGH", "Timed bans must last for less than 2 years." }, { "CSMSG_LAME_MASK", "$b%s$b is a little too general. Try making it more specific." }, { "CSMSG_MASK_PROTECTED", "Sorry, ban for $b%s$b conflicts with a protected user's hostmask." }, { "CSMSG_NO_MATCHING_USERS", "No one in $b%s$b has a hostmask matching $b%s$b." }, - { "CSMSG_BAN_NOT_FOUND", "Sorry, no ban found for $b%s$b." }, + { "CSMSG_BAN_NOT_FOUND", "Sorry, no ban or LAMER found: $b%s$b." }, { "CSMSG_BANLIST_FULL", "The $b%s$b channel ban list is $bfull$b." }, { "CSMSG_INVALID_TRIM", "$b%s$b isn't a valid trim target." }, @@ -334,7 +335,7 @@ { "CSMSG_BAD_INFOLINE", "You may not use the character \\%03o in your infoline." }, { "CSMSG_KICK_DONE", "Kicked $b%s$b from %s." }, - { "CSMSG_NO_BANS", "No channel bans found on $b%s$b." }, + { "CSMSG_NO_BANS", "No bans found on $b%s$b." }, { "CSMSG_BANS_REMOVED", "Removed all channel bans from $b%s$b." }, /* Channel userlist */ @@ -342,7 +343,7 @@ { "CSMSG_ACCESS_SEARCH_HEADER", "$b%s Users From Level %s To %s Matching %s$b" }, { "CSMSG_INVALID_ACCESS", "$b%s$b is an invalid access level." }, { "CSMSG_CHANGED_ACCESS", "%s now has access $b%s$b (%u) in %s." }, - { "CSMSG_BANS_HEADER", "$bBans in %s$b" }, + { "CSMSG_LAMERS_HEADER", "$bLamers in %s$b" }, /* Channel note list */ { "CSMSG_NOTELIST_HEADER", "Notes for $b%s$b:" }, @@ -400,8 +401,8 @@ { "CSMSG_CHANNEL_MODES", "$bMode Lock: $b%s" }, { "CSMSG_CHANNEL_NOTE", "$b%s:%*s$b%s" }, { "CSMSG_CHANNEL_MAX", "$bRecord Visitors: $b%i" }, - { "CSMSG_CHANNEL_OWNER", "$bOwner: $b%s" }, - { "CSMSG_CHANNEL_BANS", "$bBan Count: $b%i" }, + { "CSMSG_CHANNEL_OWNER", "$bOwner: $b%s" }, + { "CSMSG_CHANNEL_LAMERS", "$bLamer Count: $b%i" }, { "CSMSG_CHANNEL_USERS", "$bTotal User Count: $b%i" }, { "CSMSG_CHANNEL_REGISTRAR", "$bRegistrar: $b%s" }, { "CSMSG_CHANNEL_SUSPENDED", "$b%s$b is suspended:" }, @@ -430,7 +431,7 @@ { "CSMSG_NETWORK_INFO", "Network Information:" }, { "CSMSG_NETWORK_SERVERS", "$bServers: $b%i" }, { "CSMSG_NETWORK_USERS", "$bTotal Users: $b%i" }, - { "CSMSG_NETWORK_BANS", "$bTotal Ban Count: $b%i" }, + { "CSMSG_NETWORK_LAMERS", "$bTotal Lamer Count: $b%i" }, { "CSMSG_NETWORK_CHANUSERS", "$bTotal User Count: $b%i" }, { "CSMSG_NETWORK_OPERS", "$bIRC Operators: $b%i" }, { "CSMSG_NETWORK_CHANNELS","$bRegistered Channels: $b%i" }, @@ -478,10 +479,10 @@ /* eject_user and unban_user flags */ #define ACTION_KICK 0x0001 #define ACTION_BAN 0x0002 -#define ACTION_ADD_BAN 0x0004 -#define ACTION_ADD_TIMED_BAN 0x0008 +#define ACTION_ADD_LAMER 0x0004 +#define ACTION_ADD_TIMED_LAMER 0x0008 #define ACTION_UNBAN 0x0010 -#define ACTION_DEL_BAN 0x0020 +#define ACTION_DEL_LAMER 0x0020 /* The 40 allows for [+-ntlksimprD] and lots of fudge factor. */ #define MODELEN 40 + KEYLEN @@ -532,7 +533,7 @@ unsigned int max_owned; unsigned int max_chan_users; - unsigned int max_chan_bans; + unsigned int max_chan_bans; /* lamers */ unsigned int max_userinfo_length; struct string_list *set_shows; @@ -874,11 +875,11 @@ eflags |= ACTION_BAN; break; case 't': - eflags |= ACTION_BAN | ACTION_ADD_BAN | ACTION_ADD_TIMED_BAN; + eflags |= ACTION_BAN | ACTION_ADD_LAMER | ACTION_ADD_TIMED_LAMER; argv[argc++] = (char*)chanserv_conf.ctcp_short_ban_duration; break; case 'T': - eflags |= ACTION_BAN | ACTION_ADD_BAN | ACTION_ADD_TIMED_BAN; + eflags |= ACTION_BAN | ACTION_ADD_LAMER | ACTION_ADD_TIMED_LAMER; argv[argc++] = (char*)chanserv_conf.ctcp_long_ban_duration; break; } @@ -1375,7 +1376,7 @@ timeq_add(expires, expire_ban, bd); bd->prev = NULL; - bd->next = channel->bans; + bd->next = channel->bans; /* lamers */ if(channel->bans) channel->bans->prev = bd; channel->bans = bd; @@ -1409,7 +1410,7 @@ } static void -expire_ban(void *data) +expire_ban(void *data) /* lamer.. */ { struct banData *bd = data; if(!IsSuspended(bd->channel)) @@ -1447,7 +1448,7 @@ up: - Channel information. - Channel users. - - Channel bans. + - Channel bans. (lamers) - Channel suspension data. - adduser_pending data. - Timeq entries. (Except timed bans, which are handled elsewhere.) @@ -2643,6 +2644,7 @@ } +/* trim_lamers.. */ static int cmd_trim_bans(struct userNode *user, struct chanNode *channel, unsigned long duration) { @@ -2665,7 +2667,7 @@ } intervalString(interval, duration, user->handle_info); - send_message(user, chanserv, "CSMSG_TRIMMED_BANS", count, channel->name, interval); + send_message(user, chanserv, "CSMSG_TRIMMED_LAMERS", count, channel->name, interval); return 1; } @@ -2730,9 +2732,9 @@ return 0; } - if(!irccasecmp(argv[1], "bans")) + if(!irccasecmp(argv[1], "lamers")) { - cmd_trim_bans(user, channel, duration); + cmd_trim_bans(user, channel, duration); /* trim_lamers.. */ return 1; } else if(!irccasecmp(argv[1], "users")) @@ -2969,7 +2971,7 @@ char *reason = "Bye.", *ban, *name; char interval[INTERVALLEN]; - offset = (action & ACTION_ADD_TIMED_BAN) ? 3 : 2; + offset = (action & ACTION_ADD_TIMED_LAMER) ? 3 : 2; REQUIRE_PARAMS(offset); if(argc > offset) { @@ -3055,18 +3057,18 @@ that 'ban' is a valid ban mask before sanitizing it. */ sanitize_ircmask(ban); - if(action & ACTION_ADD_BAN) + if(action & ACTION_ADD_LAMER) { struct banData *bData, *next; - if(channel->channel_info->banCount >= chanserv_conf.max_chan_bans) + if(channel->channel_info->banCount >= chanserv_conf.max_chan_bans) /* ..lamers.. */ { - reply("CSMSG_MAXIMUM_BANS", chanserv_conf.max_chan_bans); + reply("CSMSG_MAXIMUM_LAMERS", chanserv_conf.max_chan_bans); /* ..lamers.. */ free(ban); return 0; } - if(action & ACTION_ADD_TIMED_BAN) + if(action & ACTION_ADD_TIMED_LAMER) { duration = ParseInterval(argv[2]); @@ -3084,6 +3086,7 @@ } } + /* lamers... */ for(bData = channel->channel_info->bans; bData; bData = next) { if(match_ircglobs(bData->mask, ban)) @@ -3135,15 +3138,15 @@ /* automated kickban */ } else if(duration) - reply("CSMSG_BAN_EXTENDED", ban, intervalString(interval, duration, user->handle_info)); + reply("CSMSG_LAMER_EXTENDED", ban, intervalString(interval, duration, user->handle_info)); else - reply("CSMSG_BAN_ADDED", name, channel->name); + reply("CSMSG_LAMER_ADDED", name, channel->name); goto post_add_ban; } } if(cmd) - reply("CSMSG_REDUNDANT_BAN", name, channel->name); + reply("CSMSG_REDUNDANT_LAMER", name, channel->name); free(ban); return 0; @@ -3240,12 +3243,12 @@ { /* No response, since it was automated. */ } - else if(action & ACTION_ADD_BAN) + else if(action & ACTION_ADD_LAMER) { if(duration) - reply("CSMSG_TIMED_BAN_ADDED", name, channel->name, intervalString(interval, duration, user->handle_info)); + reply("CSMSG_TIMED_LAMER_ADDED", name, channel->name, intervalString(interval, duration, user->handle_info)); else - reply("CSMSG_BAN_ADDED", name, channel->name); + reply("CSMSG_LAMER_ADDED", name, channel->name); } else if((action & (ACTION_BAN | ACTION_KICK)) == (ACTION_BAN | ACTION_KICK)) reply("CSMSG_KICK_BAN_DONE", name, channel->name); @@ -3273,14 +3276,14 @@ return eject_user(CSFUNC_ARGS, ACTION_BAN); } -static CHANSERV_FUNC(cmd_addban) +static CHANSERV_FUNC(cmd_addlamer) { - return eject_user(CSFUNC_ARGS, ACTION_KICK | ACTION_BAN | ACTION_ADD_BAN); + return eject_user(CSFUNC_ARGS, ACTION_KICK | ACTION_BAN | ACTION_ADD_LAMER); } -static CHANSERV_FUNC(cmd_addtimedban) +static CHANSERV_FUNC(cmd_addtimedlamer) { - return eject_user(CSFUNC_ARGS, ACTION_KICK | ACTION_BAN | ACTION_ADD_BAN | ACTION_ADD_TIMED_BAN); + return eject_user(CSFUNC_ARGS, ACTION_KICK | ACTION_BAN | ACTION_ADD_LAMER | ACTION_ADD_TIMED_LAMER); } static struct mod_chanmode * @@ -3362,11 +3365,11 @@ } } - if(action & ACTION_DEL_BAN) + if(action & ACTION_DEL_LAMER) { struct banData *ban, *next; - ban = channel->channel_info->bans; + ban = channel->channel_info->bans; /* lamers */ while(ban) { if(actee) @@ -3398,11 +3401,11 @@ return unban_user(CSFUNC_ARGS, ACTION_UNBAN); } -static CHANSERV_FUNC(cmd_delban) +static CHANSERV_FUNC(cmd_dellamer) { /* it doesn't necessarily have to remove the channel ban - may want to make that an option. */ - return unban_user(CSFUNC_ARGS, ACTION_UNBAN | ACTION_DEL_BAN); + return unban_user(CSFUNC_ARGS, ACTION_UNBAN | ACTION_DEL_LAMER); } static CHANSERV_FUNC(cmd_unbanme) @@ -3412,7 +3415,7 @@ /* remove permanent bans if the user has the proper access. */ if(uData->access >= UL_MANAGER) - flags |= ACTION_DEL_BAN; + flags |= ACTION_DEL_LAMER; argv[1] = user->nick; return unban_user(user, channel, 2, argv, cmd, flags); @@ -3858,22 +3861,23 @@ return cmd_list_users(CSFUNC_ARGS, 1, UL_HALFOP-1); } -static CHANSERV_FUNC(cmd_bans) +static CHANSERV_FUNC(cmd_lamers) { struct helpfile_table tbl; unsigned int matches = 0, timed = 0, ii; char t_buffer[INTERVALLEN], e_buffer[INTERVALLEN], *search; const char *msg_never, *triggered, *expires; - struct banData *ban, **bans; + struct banData *ban, **bans; /* lamers */ if(argc > 1) search = argv[1]; else search = NULL; - reply("CSMSG_BANS_HEADER", channel->name); - bans = alloca(channel->channel_info->banCount * sizeof(struct banData *)); + reply("CSMSG_LAMERS_HEADER", channel->name); + bans = alloca(channel->channel_info->banCount * sizeof(struct banData *)); /* lamers */ + /* lamers */ for(ban = channel->channel_info->bans; ban; ban = ban->next) { if(search && !match_ircglobs(search, ban->mask)) @@ -4267,7 +4271,7 @@ if(owner->access == UL_OWNER) reply("CSMSG_CHANNEL_OWNER", owner->handle->handle); reply("CSMSG_CHANNEL_USERS", cData->userCount); - reply("CSMSG_CHANNEL_BANS", cData->banCount); + reply("CSMSG_CHANNEL_LAMERS", cData->banCount); reply("CSMSG_CHANNEL_VISITED", intervalString(buffer, now - cData->visited, user->handle_info)); reply("CSMSG_CHANNEL_REGISTERED", intervalString(buffer, now - cData->registered, user->handle_info)); @@ -4305,7 +4309,7 @@ reply("CSMSG_NETWORK_USERS", dict_size(clients)); reply("CSMSG_NETWORK_OPERS", curr_opers.used); reply("CSMSG_NETWORK_CHANNELS", registered_channels); - reply("CSMSG_NETWORK_BANS", banCount); + reply("CSMSG_NETWORK_LAMERS", banCount); reply("CSMSG_NETWORK_CHANUSERS", userCount); reply("CSMSG_SERVICES_UPTIME", intervalString(interval, time(NULL) - boot_time, user->handle_info)); reply("CSMSG_BURST_LENGTH", intervalString(interval, burst_length, user->handle_info)); @@ -7672,14 +7676,14 @@ DEFINE_COMMAND(voice, 2, MODCMD_REQUIRE_CHANNEL, "template", "op", NULL); DEFINE_COMMAND(devoice, 2, MODCMD_REQUIRE_CHANNEL, "template", "op", NULL); - DEFINE_COMMAND(kickban, 2, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL); - DEFINE_COMMAND(kick, 2, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL); - DEFINE_COMMAND(ban, 2, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL); - DEFINE_COMMAND(unban, 2, 0, "template", "op", NULL); - DEFINE_COMMAND(unbanall, 1, 0, "template", "op", NULL); - DEFINE_COMMAND(unbanme, 1, MODCMD_REQUIRE_CHANUSER, "template", "op", NULL); + DEFINE_COMMAND(kickban, 2, MODCMD_REQUIRE_REGCHAN, "template", "hop", NULL); + DEFINE_COMMAND(kick, 2, MODCMD_REQUIRE_REGCHAN, "template", "hop", NULL); + DEFINE_COMMAND(ban, 2, MODCMD_REQUIRE_REGCHAN, "template", "hop", NULL); + DEFINE_COMMAND(unban, 2, 0, "template", "hop", NULL); + DEFINE_COMMAND(unbanall, 1, 0, "template", "hop", NULL); + DEFINE_COMMAND(unbanme, 1, MODCMD_REQUIRE_CHANUSER, "template", "hop", NULL); DEFINE_COMMAND(open, 1, MODCMD_REQUIRE_CHANUSER, "template", "op", NULL); - DEFINE_COMMAND(topic, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", "flags", "+never_csuspend", NULL); + DEFINE_COMMAND(topic, 1, MODCMD_REQUIRE_REGCHAN, "template", "hop", "flags", "+never_csuspend", NULL); DEFINE_COMMAND(mode, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL); DEFINE_COMMAND(inviteme, 1, MODCMD_REQUIRE_CHANNEL, "access", "1", NULL); DEFINE_COMMAND(invite, 1, MODCMD_REQUIRE_CHANNEL, "access", "manager", NULL); @@ -7687,13 +7691,17 @@ DEFINE_COMMAND(wipeinfo, 2, MODCMD_REQUIRE_CHANUSER, "access", "manager", NULL); DEFINE_COMMAND(resync, 1, MODCMD_REQUIRE_CHANUSER, "access", "manager", NULL); - DEFINE_COMMAND(events, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog", "access", "350", NULL); - DEFINE_COMMAND(addban, 2, MODCMD_REQUIRE_REGCHAN, "access", "250", NULL); - DEFINE_COMMAND(addtimedban, 3, MODCMD_REQUIRE_REGCHAN, "access", "250", NULL); - DEFINE_COMMAND(delban, 2, MODCMD_REQUIRE_REGCHAN, "access", "250", NULL); + DEFINE_COMMAND(events, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog", "access", "manager", NULL); + DEFINE_COMMAND(addlamer, 2, MODCMD_REQUIRE_REGCHAN, "access", "manager", NULL); + DEFINE_COMMAND(addtimedlamer, 3, MODCMD_REQUIRE_REGCHAN, "access", "manager", NULL); + + /* if you change dellamer access, see also places + * like unbanme which have manager hardcoded. */ + DEFINE_COMMAND(dellamer, 2, MODCMD_REQUIRE_REGCHAN, "access", "manager", NULL); DEFINE_COMMAND(uset, 1, MODCMD_REQUIRE_CHANUSER, "access", "1", NULL); - DEFINE_COMMAND(bans, 1, MODCMD_REQUIRE_REGCHAN, "access", "1", "flags", "+nolog", NULL); + DEFINE_COMMAND(lamers, 1, MODCMD_REQUIRE_REGCHAN, "access", "1", "flags", "+nolog", NULL); + DEFINE_COMMAND(peek, 1, MODCMD_REQUIRE_REGCHAN, "access", "op", "flags", "+nolog", NULL); DEFINE_COMMAND(myaccess, 1, MODCMD_REQUIRE_AUTHED, NULL); Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.12 x3/src/chanserv.help:1.13 --- x3/src/chanserv.help:1.12 Wed May 4 16:56:48 2005 +++ x3/src/chanserv.help Thu May 5 17:30:51 2005 @@ -37,8 +37,8 @@ " $bADDMANAGER$b Add a user as a MANAGER in a channel.", " $bADDCOOWNER$b Add a user as COOWNER in a channel.", " $bADDUSER$b A more advanced way to add users.", - " $bADDBAN$b Add a $upermanent$u ban for a user.", - " $bADDTIMEDBAN$b Add a $ulasting$u ban that expires in the specified time.", + " $bADDLAMER$b Add a lamer to the lamers (keep out) list.", + " $bADDTIMEDLAMER$b Add a lamer to the lamers list that expires in the specified time.", "$b$b", " $bDELUSER$b Delete a user from the userlist.", " $bMDELCOOWNER$b Mass-delete coowners with accounts matching a mask.", @@ -46,7 +46,7 @@ " $bMDELOP$b Mass-delete ops with accounts matching a mask.", " $bMDELHOP$b Mass-delete halfops with accounts matching a mask.", " $bMDELPEON$b Mass-delete peons with accounts matching a mask.", - " $bDELBAN$b Remove the specified $upermanent$u ban from memory.", + " $bDELLAMER$b Remove the specified lamer from the lamer list.", " $bWIPEINFO$b Remove a lower-ranked user's infoline.", " $bTRIM$b Delete users who are inactive.", " $bSUSPEND$b Suspend a user's access to a channel.", @@ -181,9 +181,11 @@ "ACCESS" ("/msg $S ACCESS <#channel> [<nick|*account>]", "Reports various pieces of information about a channel user, including channel and network access level, and the user's info line. If no nick or account is provided, $S returns your own information.", "$uSee Also:$u myaccess, users"); -"ADDBAN" ("/msg $C ADDBAN <#channel> <mask|nick> [Reason]", - "Adds a ban to the channels permanent ban list, remaining in effect until removed with the DELBAN command. If it exactly matches an existing ban already in the list, the reason will be updated. If the existing ban was a timed ban, it will be extended into a permanent ban.", - "$uSee Also:$u bans, delban, mdelban"); +"ADDLAMER" ("/msg $C ADDLAMER <#channel> <mask|nick> [Reason]", + "Adds a lamer to the channels lamer list, remaining in effect until removed with the DELLAMER command. ", + "Lamers are nick!user@host masks which $C watches for, and keeps out of your channel.", + "If it exactly matches an existing lamer already in the list, the reason will be updated. If the existing lamer was a timed lamer, it will be extended into a permanent lamer.", + "$uSee Also:$u bans, dellamer, mdellamer"); "ADDUSER" ("/msg $C ADDUSER <#channel> <nick|*account> <level>", "This command adds someone to the channel user list with the specified access level. (You may only add users to levels less than your own.)", "The level may be one of $bpeon$b, $bop$b, $bmanager$b, $bcoowner$b, $bowner$b, or a number between 1 and 500. Only network staff may add level 500 users (owners).", @@ -194,9 +196,11 @@ "ADDHOP" ("/msg $C ADDHOP <#channel> <nick|*account>", "This command adds someone to the channel user list with HALFOP access level. (You may only add users to levels less than your own.)", "$uSee Also:$u adduser, deluser, users"); -"ADDTIMEDBAN" ("/msg $C ADDTIMEDBAN <#channel> <mask|nick> <Duration> [Reason]", - "Adds an automatically expiring ban to the channel ban list. This command behaves in the exact same fashion as ADDBAN with the exception that the bans are automatically removed after the user-supplied duration. If it exactly matches an existing ban already in the list, the reason will be updated. If the existing ban was a timed ban, it will be extended. Timed bans can be removed with the DELBAN command, as with permanent bans.", - "$uSee Also:$u addban, bans, delban, durations"); +"ADDTIMEDLAMER" ("/msg $C ADDTIMEDLAMER <#channel> <mask|nick> <Duration> [Reason]", + "Adds an automatically expiring lamer to the channel lamer list.", + "This command behaves in the exact same fashion as $bADDLAMER$b with the exception that the bans are automatically removed after the user-supplied duration. ", + "If it exactly matches an existing lamer already in the list, the reason will be updated. If the existing lamer was a timed lamer, it will be extended. Timed lamers can be removed with the $bDELLAMER$b command, as with permanent lamers.", + "$uSee Also:$u addlamer, lamers, dellamer, durations"); "ALLOWREGISTER" ("/msg $C ALLOWREGISTER <#channel|*Account>", "Removes the named channel (or channel mask) from the do-not-register list.", "$uSee Also:$u register, noregister, unregister"); @@ -205,9 +209,10 @@ "$uFor assistance, please join #Help$u", "Example: *!*serv@*.afternet.org would ban anyone with ident 'serv' and an afternet.org hostname from joining the channel.", "$uSee Also:$u unban, unbanall, unbanme"); -"BANS" ("/msg $C BANS <#channel> [mask]", - "This command lists all permanent and timed bans in the channel matching mask.", - "$uSee Also:$u addban, delban, mdelban"); +"LAMERS" ("/msg $C LAMERS <#channel> [mask]", + "This command lists all permanent and timed lamers in the channel matching an optional mask.", + "Lamers are nick!user@host masks which $C watches for, and keeps out of your channel.", + "$uSee Also:$u addlamer, dellamer, addtimedlamer"); "CALC" ("/msg $C CALC <expression>", "CALC calculates a mathematical expression, and returns the answer. It", "supports +, -, *, /, ^, and () and many other math operations, such as", @@ -245,9 +250,9 @@ "CUNSUSPEND" ("/msg $C CUNSUSPEND <#channel>", "Restores a channel's $b$C$b registration.", "$uSee Also:$u csuspend, unregister"); -"DELBAN" ("/msg $C DELBAN <#channel> <mask|nick>", - "Deletes a ban from the channel ban list. This command works for both permanent and timed bans alike.", - "$uSee Also:$u addban, addtimedban, bans"); +"DELLAMER" ("/msg $C DELLAMER <#channel> <mask|nick>", + "Deletes a lamer from the channel lamer list. This command works for both permanent and timed lamers alike.", + "$uSee Also:$u addlamer, addtimedlamer, lamers"); "DELNOTE" ("/msg $C DELNOTE <#channel> <note-name>", "Deletes a note from the channel. To do this, you must be able to set the note.", "$uSee Also:$u note, note types"); Index: x3/src/modcmd.c diff -u x3/src/modcmd.c:1.14 x3/src/modcmd.c:1.15 --- x3/src/modcmd.c:1.14 Sat Apr 23 23:07:26 2005 +++ x3/src/modcmd.c Thu May 5 17:30:51 2005 @@ -1917,6 +1917,14 @@ return 1; } +static void create_default_binds(int rebind); + +static MODCMD_FUNC(cmd_rebindall) { + send_message_type(4, user, cmd->parent->bot, "$bRe-binding all default commands to respective services..$b"); + create_default_binds(1); + return 1; +} + void modcmd_nick_change(struct userNode *user, const char *old_nick) { @@ -2159,6 +2167,7 @@ modcmd_register(modcmd_module, "service privileged", cmd_service_privileged, 2, 0, "flags", "+oper", NULL); modcmd_register(modcmd_module, "service remove", cmd_service_remove, 2, 0, "flags", "+oper", NULL); modcmd_register(modcmd_module, "dumpmessages", cmd_dump_messages, 1, 0, "oper_level", "1000", NULL); + modcmd_register(modcmd_module, "rebindall", cmd_rebindall, 0, MODCMD_KEEP_BOUND, "oper_level", "800", NULL); version_command = modcmd_register(modcmd_module, "version", cmd_version, 1, 0, NULL); message_register_table(msgtab); } @@ -2324,7 +2333,7 @@ } static void -create_default_binds(void) { +create_default_binds(int rebind) { /* Which services should import which modules by default? */ struct { const char *svcname; @@ -2351,7 +2360,7 @@ continue; if (!(service = service_find(nick))) continue; - if (dict_size(service->commands) > 0) + if (dict_size(service->commands) > 0 && !rebind) continue; /* Bind the default modules for this service to it */ @@ -2369,6 +2378,7 @@ if (!irccasecmp(def_binds[ii].svcname, "ChanServ")) { service_make_alias(service, "addowner", "*chanserv.adduser", "$1", "owner", NULL); service_make_alias(service, "addcoowner", "*chanserv.adduser", "$1", "coowner", NULL); + service_make_alias(service, "addco", "*chanserv.adduser", "$1", "coowner", NULL); service_make_alias(service, "addmanager", "*chanserv.adduser", "$1", "manager", NULL); service_make_alias(service, "addop", "*chanserv.adduser", "$1", "op", NULL); service_make_alias(service, "addhop", "*chanserv.adduser", "$1", "halfop", NULL); @@ -2378,6 +2388,7 @@ service_make_alias(service, "delmanager", "*chanserv.deluser", "manager", "$1", NULL); service_make_alias(service, "delop", "*chanserv.deluser", "op", "$1", NULL); service_make_alias(service, "delpeon", "*chanserv.deluser", "peon", "$1", NULL); + service_make_alias(service, "llist", "*chanserv.lamers", "1", "$1", NULL); service_make_alias(service, "command", "*modcmd.command", NULL); service_make_alias(service, "god", "*modcmd.god", NULL); } else if (!irccasecmp(def_binds[ii].svcname, "OpServ")) { @@ -2427,7 +2438,7 @@ /* Check databases. */ saxdb_register("modcmd", modcmd_saxdb_read, modcmd_saxdb_write); - create_default_binds(); + create_default_binds(0); if (!saxdb_present) import_aliases_db(); Index: x3/src/modcmd.help diff -u x3/src/modcmd.help:1.4 x3/src/modcmd.help:1.5 --- x3/src/modcmd.help:1.4 Tue May 3 23:30:32 2005 +++ x3/src/modcmd.help Thu May 5 17:30:51 2005 @@ -18,8 +18,9 @@ " You may need to run this after installing previously", " missing modules, or making changes such as enabling", " the email features, so all the commands are bound.", - " Note: Certain(??) commands will not bind this way; ", - " you must bind them by name.", + " Note: Certain(alias) commands will not bind this way; ", + " you must bind them by name. ", + " See $bREBINDALL$b to rebind everything.", "$b$b", "For simplicity, you cannot bind to a command that is an alias.", "$b$b", @@ -30,10 +31,16 @@ " bind O3 murder o3.trace gline nick $$1 duration 1m reason $$2-", " bind X3 * *chanserv.*", "$b$b", - "$uSee also:$u unbind, joiner"); + "$uSee also:$u unbind, joiner, modcmd, rebindall"); "commands" "${index}"; +"rebindall" ("/msg $S REBINDALL", + "Rebinds all available delault commands and aliases for each service and module currently loaded.", + "Note: this does NOT remove any additional aliases or bindings you may have made, but will replace any you have deleted.", + "Good to use after upgrades or after enabling 'email' support to ensure you have all commands bound to a service bot.", + "$uSee also:$u bind (esp 'bind nick * *mod.*'), unbind, modcmd"); + "god" ("/msg $C GOD [on|off]", "Toggles security override, which grants you complete access to all channels. Please use carefully."); @@ -55,7 +62,8 @@ "Reports how long it takes to run the specified command."); "command" ("/msg $S COMMAND <command>", - "Shows the restrictions on who can use the named command (and how)."); + "Shows the restrictions on who can use the named command (and how).", + "$uSee Also:$u modcmd, bind"); "modcmd" ("/msg $S MODCMD <command> [<option> <newval> ...]", "Displays options for the specified command, or changes the options and values listed. The command name may be prefixed with $bServiceNick.$b to specify another service's command (for example, $N.AUTH to refer to the auth command).", @@ -64,7 +72,8 @@ " CHANNEL_ACCESS Minimum ChanServ access.", " OPER_ACCESS Minimum OpServ access.", " ACCOUNT_FLAGS Account flags to require or deny (for example, +R-S)", - "See the $bmodcmd flags$b help entry for a list of supported flags."); + "See the $bmodcmd flags$b help entry for a list of supported flags.", + "$uSee Also:$u modcmd flags, command, bind"); "modcmd flags" ("The following flags are supported for commands:", " ACCEPTCHAN Treat a normal channel name (if specified) as the context for the command", Index: x3/src/opserv.help diff -u x3/src/opserv.help:1.6 x3/src/opserv.help:1.7 --- x3/src/opserv.help:1.6 Sat Mar 19 17:11:35 2005 +++ x3/src/opserv.help Thu May 5 17:30:51 2005 @@ -135,6 +135,7 @@ " $bMODCMD$b Change details of a command.", " $bBIND$b Make a command alias.", " $bUNBIND$b Remove a command alias.", + " $bREBINDALL$b Re-create all missing commands on all services", " $bHELPFILES$b Change the helpfile priority order.", " $b$b", " $bSERVICE ADD$b Create a new service bot.", ----------------------- End of diff ----------------------- |