[X2serv-cvs] [CVS] Module x3: Change committed
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2005-05-18 18:37:51
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-18 18:37:44 UTC Modified files: ChangeLog.X3 src/chanserv.c src/chanserv.help src/helpfile.c src/modcmd.c src/nickserv.help src/opserv.help Log message: More tweaks to help and some spelling ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.32 x3/ChangeLog.X3:1.33 --- x3/ChangeLog.X3:1.32 Wed May 18 10:51:05 2005 +++ x3/ChangeLog.X3 Wed May 18 11:37:33 2005 @@ -3,19 +3,24 @@ 2005-05-18 Alex Schumann <ru...@af...> - * src/modcmd.c: Fixed up the help system (again) + * src/helpfile.c: make send_help() return true/false and not send + errors so svccmd_send_help can 'take control' of things. + + * src/modcmd.c: Fixed up the help system (again) / find aliased + commands help if none exists. * src/modcmd.h: Fixed up the help system (again) * src/global.c: Fixed syntax display * src/chanserv.help: Removed =---= formatting, fixed a few things. - *spelling + *spelling ++more spelling (thx reed) * src/nickserv.help: Removed =---= formatting, fixed a few things. - *spelling + *spelling ++more spelling (thx reed) * src/opserv.help: Removed =---= formatting, fixed a few things. + ++spelling (thx reed) * src/global.help: simplified index @@ -212,5 +217,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.32 $" +#define CVS_VERSION "$Revision: 1.33 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.27 x3/src/chanserv.c:1.28 --- x3/src/chanserv.c:1.27 Thu May 5 17:30:51 2005 +++ x3/src/chanserv.c Wed May 18 11:37:34 2005 @@ -197,7 +197,9 @@ { "CSMSG_USER_EXISTS", "%s is already on the $b%s$b user list (with %s access)." }, { "CSMSG_ADDUSER_PENDING", "I have sent him/her a message letting them know, and if they auth or register soon, i will finish adding them automatically." }, { "CSMSG_ADDUSER_PENDING_ALREADY", "He or she is already pending addition to %s once he/she auths with $b$N$b." }, - { "CSMSG_ADDUSER_PENDING_LIST", "Channel %s user %s" }, /* Remove after testing */ + { "CSMSG_ADDUSER_PENDING_HEADER", "Users to add to channels pending logins:" }, /* Remove after testing? */ + { "CSMSG_ADDUSER_PENDING_LIST", "Channel %s user %s" }, /* Remove after testing? */ + { "CSMSG_ADDUSER_PENDING_HEADER", "--------- End of pending list ----------" }, /* Remove after testing? */ /*{ "CSMSG_ADDUSER_PENDING_NOTINCHAN", "That user is not in %s, and is not auth'd." }, */ { "CSMSG_ADDUSER_PENDING_TARGET", "Channel Services bot here, %s would like to add you to my userlist in channel %s, but you are not auth'd to $b$N$b. Please auth now, and you will be added. If you do not have an accont, type /msg $N help register" }, { "CSMSG_CANNOT_TRIM", "You must include a minimum inactivity duration of at least 60 seconds to trim." }, @@ -3818,11 +3820,16 @@ return 1; } +/* Remove this now that debugging is over? or improve it for + * users? Would it be better tied into USERS somehow? -Rubin */ static CHANSERV_FUNC(cmd_pending) { struct adduserPending *ap; + reply("CSMSG_ADDUSER_PENDING_HEADER"); + reply("CSMSG_BAR"); for(ap = adduser_pendings;ap;ap = ap->next) reply("CSMSG_ADDUSER_PENDING_LIST", ap->channel->name, ap->user->nick); + reply("CSMSG_ADDUSER_PENDING_FOOTER"); return 1; } @@ -7628,8 +7635,6 @@ dict_set_free_data(plain_dnrs, free); mask_dnrs = dict_new(); dict_set_free_data(mask_dnrs, free); - //TODO - //adduser_pending reg_svccmd_unbind_func(handle_svccmd_unbind); chanserv_module = module_register("ChanServ", CS_LOG, "chanserv.help", chanserv_expand_variable); Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.16 x3/src/chanserv.help:1.17 --- x3/src/chanserv.help:1.16 Wed May 18 10:51:06 2005 +++ x3/src/chanserv.help Wed May 18 11:37:34 2005 @@ -4,9 +4,9 @@ " $b$b", " Please select the area you would like ", " help with from the list below. The ", - " help system uses the format: ", + " help system uses the format: ", " $b/MSG $C HELP <$bsubject$b>$b ", - " (In help, Words in <> represent required", + " (In help, words in <> represent required", " parameters. Words in [] are optional.)", " For example: $b/msg $C HELP UBM$b ", " shows help with the Un-Ban Me command. ", Index: x3/src/helpfile.c diff -u x3/src/helpfile.c:1.8 x3/src/helpfile.c:1.9 --- x3/src/helpfile.c:1.8 Wed Apr 20 07:39:48 2005 +++ x3/src/helpfile.c Wed May 18 11:37:34 2005 @@ -745,7 +745,7 @@ topic = "<index>"; if (!hf) { _send_help(dest, src, NULL, "HFMSG_MISSING_HELPFILE"); - return 0; + return false; } for (curr = (dest->handle_info ? dest->handle_info->language : lang_C); curr; @@ -754,15 +754,20 @@ if (!lang_hf) continue; rec = dict_find(lang_hf->db, topic, NULL); - if (rec && rec->type == RECDB_QSTRING) - return _send_help(dest, src, hf->expand, rec->d.qstring); + if (rec && rec->type == RECDB_QSTRING) { + _send_help(dest, src, hf->expand, rec->d.qstring); + return true; + } } rec = dict_find(hf->db, "<missing>", NULL); if (!rec) - return send_message(dest, src, "MSG_TOPIC_UNKNOWN"); - if (rec->type != RECDB_QSTRING) - return send_message(dest, src, "HFMSG_HELP_NOT_STRING"); - return _send_help(dest, src, hf->expand, rec->d.qstring); + return false; + if (rec->type != RECDB_QSTRING) { + send_message(dest, src, "HFMSG_HELP_NOT_STRING"); + return false; + } + _send_help(dest, src, hf->expand, rec->d.qstring); + return true; } int Index: x3/src/modcmd.c diff -u x3/src/modcmd.c:1.16 x3/src/modcmd.c:1.17 --- x3/src/modcmd.c:1.16 Wed May 18 09:03:13 2005 +++ x3/src/modcmd.c Wed May 18 11:37:34 2005 @@ -789,6 +789,7 @@ struct svccmd *cmd; char cmdname[MAXLEN]; unsigned int nn; + int helpsent = 0; /* If there is no topic show the index */ if (!topic) @@ -803,7 +804,7 @@ { send_message(user, service->bot, "MCMSG_HELP_COMMAND_HEADER", cmdname); send_message(user, service->bot, "MCMSG_HELP_DIVIDER"); - send_help(user, service->bot, cmd->command->parent->helpfile, cmd->name); + helpsent = send_help(user, service->bot, cmd->command->parent->helpfile, cmd->name); /* Show if its an alias, or a binding of another command */ if (cmd->alias.used) @@ -811,11 +812,20 @@ char alias_text[MAXLEN]; unsplit_string((char**)cmd->alias.list, cmd->alias.used, alias_text); send_message(user, service->bot, "MCMSG_HELP_COMMAND_ALIAS", alias_text); + /* If send_help above didnt work, try again with the referenced command.. */ + if(!helpsent) + helpsent = send_help(user, service->bot, cmd->command->parent->helpfile, alias_text); } else if(cmd->command->name && strcasecmp(cmd->command->name, cmd->name)) { send_message(user, service->bot, "MCMSG_HELP_COMMAND_ALIAS", cmd->command->name); + /* If send_help above didnt work, try again with the referenced command.. */ + if(!helpsent) + helpsent = send_help(user, service->bot, cmd->command->parent->helpfile, cmd->command->name); } + /* If send_help still couldnt find it, tell them sorry */ + if(!helpsent) + send_message(user, service->bot, "MSG_TOPIC_UNKNOWN"); send_message(user, service->bot, "MCMSG_HELP_FOOTER"); return true; } @@ -829,7 +839,8 @@ send_message(user, service->bot, "MCMSG_HELP_TOPIC_HEADER", cmdname); send_message(user, service->bot, "MCMSG_HELP_DIVIDER"); - send_help(user, service->bot, module->helpfile, topic); + if(!send_help(user, service->bot, module->helpfile, topic)) + send_message(user, service->bot, "MSG_TOPIC_UNKNOWN"); send_message(user, service->bot, "MCMSG_HELP_FOOTER"); return true; } Index: x3/src/nickserv.help diff -u x3/src/nickserv.help:1.13 x3/src/nickserv.help:1.14 --- x3/src/nickserv.help:1.13 Wed May 18 10:51:06 2005 +++ x3/src/nickserv.help Wed May 18 11:37:34 2005 @@ -8,12 +8,12 @@ " with $C, and its how ircops are known", " to $O and $G.", " $b$b", - " The help system uses the format:", + " The help system uses the format:", " $b/MSG $N HELP <$bsubject$b>$b ", - " (In help, Words in <> represent required", + " (In help, words in <> represent required", " parameters. Words in [] are optional.)", " For example: $b/msg $N HELP RESETPASS$b", - " shows help with the command to reset a ", + " shows help with the command to reset a", " lost password.", " $b$b", " $b$N$b help categories:", Index: x3/src/opserv.help diff -u x3/src/opserv.help:1.8 x3/src/opserv.help:1.9 --- x3/src/opserv.help:1.8 Wed May 18 09:03:13 2005 +++ x3/src/opserv.help Wed May 18 11:37:34 2005 @@ -5,7 +5,7 @@ " $bPUNISH$b Commands to discipline users.", " $bINFORMATION$b Get information about users. ", " or $O, $C, and $N. ", - " $bTRACES$b Powerfull commands for ", + " $bTRACES$b Powerful commands for ", " viewing or acting on lists of", " IRC objects. ", " $bALERTS$b Automated responses. ", ----------------------- End of diff ----------------------- |