Thread: [X2serv-cvs] [CVS] Module x3: Change committed (Page 2)
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2005-05-01 16:39:22
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-01 16:39:15 UTC Added files: languages/lang_export.sh Log message: adding a language translation helper script. ---------------------- diff included ---------------------- Index: x3/languages/lang_export.sh diff -u /dev/null x3/languages/lang_export.sh:1.1 --- /dev/null Sun May 1 09:39:16 2005 +++ x3/languages/lang_export.sh Sun May 1 09:39:05 2005 @@ -0,0 +1,10 @@ +#!/bin/sh +# +# run this script and pipe the output to LANG/strings.db, then change the english strings +# to LANG. (where LANG is the language code, eg fr, de, etc). DO NOT change the order of %s %d etc +# in the help file! +# +# Then, copy *.help into LANG/ and translate them too. +# +# thanks to Nei for this: +grep -lR ry\ ms ..|grep -v '{arch'|xargs perl -ne 'if(/message_entry msgtab/../{ NULL, NULL }/){print"$1 $2;\n"if/\s+{ (".*?"), (".*") },/}' ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-04 06:30:56
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-04 06:30:42 UTC Modified files: ChangeLog.X3 src/chanserv.c src/chanserv.h src/chanserv.help src/hash.h src/modcmd.help src/proto-p10.c Added files: UPGRADE languages/README.txt Log message: autoop, voice, bind, +Z mode ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.23 x3/ChangeLog.X3:1.24 --- x3/ChangeLog.X3:1.23 Sat Apr 23 23:07:25 2005 +++ x3/ChangeLog.X3 Tue May 3 23:30:29 2005 @@ -1,6 +1,24 @@ /*********************************************************************** X3 ChangeLog +2005-05-04 Alex Schumann <ru...@af...> + + * src/chanserv.c: changed uset noautoop to uset autoop (removed double + negitive). Added set voice to provide control over use of voice. + Implimented a basic chanserv db version control system for upgrading + seamlessly. + + * src/chanserv.help: adjusted help to reflect voice and uset autoop + changes. + + * src/hash.h: updated ssz comment from z to Z + + * src/modcmd.help: rewrote BIND help + + * src/proto-p10.c: Added Z (sslonly) support back in + + * UPGRADE: created file to document upgrading procedures needed + 2005-04-23 Alex Schumann <ru...@af...> * src/chanserv.c: removed settings: oplevel, halfoplevel, and voicelevel, hard coding them to OP, HALFOP, and PEON. Changed @@ -128,5 +146,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.23 $" +#define CVS_VERSION "$Revision: 1.24 $" Index: x3/UPGRADE diff -u /dev/null x3/UPGRADE:1.1 --- /dev/null Tue May 3 23:30:43 2005 +++ x3/UPGRADE Tue May 3 23:30:29 2005 @@ -0,0 +1,24 @@ +************************************** +*** X3 IRC Services *** +************************************** +*** IMPORTANT UPGRADE INSTRUCTIONS *** +************************************** +From srvx 1.4: + Rename srvx.conf to x3.conf + Review .conf file settings. + * remove giveops, givevoice from set_shows and add "Voice" above "Protect". + * 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). +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) +after binding in order for 'set' and 'uset' subcommand changes to function properly since +the listing is cached. Index: x3/languages/README.txt diff -u /dev/null x3/languages/README.txt:1.1 --- /dev/null Tue May 3 23:30:43 2005 +++ x3/languages/README.txt Tue May 3 23:30:31 2005 @@ -0,0 +1,38 @@ +Using translations: + copy the languages folder into your x3 runtime directory, and restart x3. + alternate languages will be available in /msg authserv set lanugage + NOTE: Currently no other languages are caught up to recent development. + if you speak them, please see below for updating instructions. + +Translating: +Thanks for your interest in helping to translate X3 to other languages. + +How to make a new language: + +1: run the export script, to make an up-to-date "C" baseline db: + ./lang_export.sh > strings.db +2: make a dir for your language such as de/ + mkdir fo +3: copy thi strings.db into your new dir + cp strings.db fo +4: copy the help files into your new dir + cp ../src/*.help fo +5: edit the .help and .db files, translating them to your laungage. + nano fo/strings.db (etc) +6: test the strings.db file + ./validate_lang.pl fo +7: fix any problems. + + +How to keep your language up to date after changes: + +1: run the export script, to make an up-to-date "C" baseline db: + ./lang_export.sh > strings.db +2: test the strings.db file + ./validate_lang.pl fo +3: fix any changes. + +You should also watch the cvs mailing list for changes in meaning of the strings +since X3 is under active development. + + Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.23 x3/src/chanserv.c:1.24 --- x3/src/chanserv.c:1.23 Sat Apr 23 23:07:26 2005 +++ x3/src/chanserv.c Tue May 3 23:30:31 2005 @@ -56,9 +56,13 @@ #define KEY_GIVEOWNERSHIP_PERIOD "giveownership_timeout" /* ChanServ database */ +#define KEY_VERSION_CONTROL "version_control" #define KEY_CHANNELS "channels" #define KEY_NOTE_TYPES "note_types" +/* version control paramiter */ +#define KEY_VERSION_NUMBER "version_number" + /* Note type parameters */ #define KEY_NOTE_OPSERV_ACCESS "opserv_access" #define KEY_NOTE_CHANNEL_ACCESS "channel_access" @@ -275,12 +279,13 @@ { "CSMSG_SET_PUBCMD", "$bPubCmd $b %d" }, { "CSMSG_SET_SETTERS", "$bSetters $b %d" }, { "CSMSG_SET_CTCPUSERS", "$bCTCPUsers $b %d" }, + { "CSMSG_SET_VOICE", "$bvoice $b %d - %s" }, { "CSMSG_SET_PROTECT", "$bProtect $b %d - %s" }, { "CSMSG_SET_TOYS", "$bToys $b %d - %s" }, { "CSMSG_SET_CTCPREACTION", "$bCTCPReaction$b %d - %s" }, { "CSMSG_SET_TOPICREFRESH", "$bTopicRefresh$b %d - %s" }, - { "CSMSG_USET_NOAUTOOP", "$bNoAutoOp $b %s" }, - { "CSMSG_USET_NOAUTOVOICE", "$bNoAutoVoice $b %s" }, + { "CSMSG_USET_AUTOOP", "$bAutoOp $b %s" }, + { "CSMSG_USET_AUTOVOICE", "$bAutoVoice $b %s" }, { "CSMSG_USET_AUTOINVITE", "$bAutoInvite $b %s" }, { "CSMSG_USET_INFO", "$bInfo $b %s" }, @@ -294,6 +299,9 @@ { "CSMSG_DEHALFOPPED_USERS", "DeHalfopped users in $b%s$b." }, { "CSMSG_VOICED_USERS", "Voiced users in $b%s$b." }, { "CSMSG_DEVOICED_USERS", "Devoiced users in $b%s$b." }, + { "CSMSG_VOICE_NONE", "Noone will be auto-voiced" }, + { "CSMSG_VOICE_PEON", "PEONs will be auto-voiced" }, + { "CSMSG_VOICE_ALL", "Everyone will be auto-voiced" }, { "CSMSG_PROTECT_ALL", "Non-users and users will be protected from those of equal or lower access." }, { "CSMSG_PROTECT_EQUAL", "Users will be protected from those of equal or lower access." }, { "CSMSG_PROTECT_LOWER", "Users will be protected from those of lower access." }, @@ -622,7 +630,11 @@ struct charOptionValues { char value; char *format_name; -} protectValues[] = { +} voiceValues[] = { + { 'n', "CSMSG_VOICE_NONE" }, + { 'p', "CSMSG_VOICE_PEON" }, + { 'a', "CSMSG_VOICE_ALL" } +}, protectValues[] = { { 'a', "CSMSG_PROTECT_ALL" }, { 'e', "CSMSG_PROTECT_EQUAL" }, { 'l', "CSMSG_PROTECT_LOWER" }, @@ -652,8 +664,9 @@ unsigned char count; struct charOptionValues *values; } charOptions[] = { - { "CSMSG_SET_PROTECT", "protect", 'l', 0, ArrayLength(protectValues), protectValues }, - { "CSMSG_SET_TOYS", "toys", 'p', 6, ArrayLength(toysValues), toysValues }, + { "CSMSG_SET_VOICE", "voice", 'p', 99, ArrayLength(voiceValues), voiceValues }, + { "CSMSG_SET_PROTECT", "protect", 'l', 0, ArrayLength(protectValues), protectValues }, + { "CSMSG_SET_TOYS", "toys", 'p', 6, ArrayLength(toysValues), toysValues }, { "CSMSG_SET_TOPICREFRESH", "topicrefresh", 'n', 8, ArrayLength(topicRefreshValues), topicRefreshValues }, { "CSMSG_SET_CTCPREACTION", "ctcpreaction", 't', 10, ArrayLength(ctcpReactionValues), ctcpReactionValues } }; @@ -662,6 +675,9 @@ struct chanData *channelList; static struct module *chanserv_module; static unsigned int userCount; +unsigned int chanserv_read_version = 0; /* db version control */ + +#define CHANSERV_DB_VERSION 2 #define GetChannelUser(channel, handle) _GetChannelUser(channel, handle, 1, 0) #define GetChannelAccess(channel, handle) _GetChannelUser(channel, handle, 0, 0) @@ -1169,6 +1185,7 @@ ud->u_next->u_prev = ud; ud->handle->channels = ud; + ud->flags = USER_FLAGS_DEFAULT; return ud; } @@ -2636,7 +2653,7 @@ change.args[0].mode = MODE_HALFOP; errmsg = "CSMSG_ALREADY_HALFOPPED"; } - else if(uData->access >= UL_PEON /* channel->channel_info->lvlOpts[lvlGiveVoice]*/) + else if(uData->access >= UL_PEON && (channel->channel_info->chOpts[chVoice] == 'p' || channel->channel_info->chOpts[chVoice] == 'a')) { change.args[0].mode = MODE_VOICE; errmsg = "CSMSG_ALREADY_VOICED"; @@ -3342,7 +3359,7 @@ continue; sbuf.used = 0; string_buffer_append_printf(&sbuf, "[%s (%d", cData->channel->name, uData->access); - if(uData->flags != USER_AUTO_OP) + if(uData->flags == USER_AUTO_OP) string_buffer_append(&sbuf, ','); if(IsUserSuspended(uData)) string_buffer_append(&sbuf, 's'); @@ -5422,6 +5439,11 @@ return 1; } +static MODCMD_FUNC(chan_opt_voice) +{ + return channel_multiple_option(chVoice, CSFUNC_ARGS); +} + static MODCMD_FUNC(chan_opt_protect) { return channel_multiple_option(chProtect, CSFUNC_ARGS); @@ -5543,7 +5565,7 @@ return 1; } -static MODCMD_FUNC(user_opt_noautoop) +static MODCMD_FUNC(user_opt_autoop) { struct userData *uData; @@ -5554,9 +5576,9 @@ return 0; } if(uData->access < UL_OP /*channel->channel_info->lvlOpts[lvlGiveOps]*/) - return user_binary_option("CSMSG_USET_NOAUTOVOICE", USER_AUTO_OP, CSFUNC_ARGS); + return user_binary_option("CSMSG_USET_AUTOVOICE", USER_AUTO_OP, CSFUNC_ARGS); else - return user_binary_option("CSMSG_USET_NOAUTOOP", USER_AUTO_OP, CSFUNC_ARGS); + return user_binary_option("CSMSG_USET_AUTOOP", USER_AUTO_OP, CSFUNC_ARGS); /* TODO: add halfops error message? or is the op one generic enough? */ } @@ -5623,7 +5645,7 @@ { char *options[] = { - "NoAutoOp", "AutoInvite", "Info" + "AutoOp", "AutoInvite", "Info" }; if(!uset_shows_list.size) @@ -6168,16 +6190,12 @@ if(channel->join_flooded) { - /* don't automatically give ops or voice during a join flood */ + /* don't automatically give non users ops or voice during a join flood */ } - /* I don't understand why we do this, so im removing it -rubin * - else if(cData->lvlOpts[lvlGiveOps] == 0) - modes |= MODE_CHANOP; - else if(cData->lvlOpts[lvlGiveHalfOps] == 0) - modes |= MODE_HALFOP; - else if(cData->lvlOpts[lvlGiveVoice] == 0) + /* EVERYONE is to get voice */ + else if(cData->chOpts[chVoice] == 'a') modes |= MODE_VOICE; - */ + greeting = cData->greeting; if(user->handle_info) { @@ -6199,14 +6217,14 @@ uData = GetTrueChannelAccess(cData, handle); if(uData && !IsUserSuspended(uData)) { - /* Ops and above were handled by the above case. */ + /* non users getting voice are handled above. */ if(IsUserAutoOp(uData)) { if(uData->access >= UL_OP /*cData->lvlOpts[lvlGiveOps]*/) modes |= MODE_CHANOP; if(uData->access >= UL_HALFOP /*cData->lvlOpts[lvlGiveHalfOps]*/) modes |= MODE_HALFOP; - else if(uData->access >= UL_PEON /* cData->lvlOpts[lvlGiveVoice] */) + else if(uData->access >= UL_PEON && cData->chOpts[chVoice] == 'p') modes |= MODE_VOICE; } if(uData->access >= UL_PRESENT) @@ -6848,6 +6866,18 @@ uData = add_channel_user(chan, handle, access, last_seen, inf); uData->flags = flags ? strtoul(flags, NULL, 0) : 0; + + /* Upgrade: set autoop to the inverse of noautoop */ + if(chanserv_read_version < 2) + { + /* if noautoop is true, set autoop false, and vice versa */ + if(uData->flags & USER_NOAUTO_OP) + uData->flags = uData->flags & ~USER_AUTO_OP; + else + uData->flags = uData->flags | USER_AUTO_OP; + log_module(CS_LOG, LOG_INFO, "UPGRADE: to db version 2 from %u. Changing flag to %d for %s in %s.", chanserv_read_version, uData->flags, key, chan->channel->name); + } + } static void @@ -7148,12 +7178,26 @@ dnr->set = 0; } +static void +chanserv_version_read(struct dict *section) +{ + /* global var.. */ + char *str; + str = database_get_data(section, KEY_VERSION_NUMBER, RECDB_QSTRING); + if(str) + chanserv_read_version = atoi(str); + log_module(CS_LOG, LOG_DEBUG, "Chanserv db version is %d.", chanserv_read_version); +} + static int chanserv_saxdb_read(struct dict *database) { struct dict *section; dict_iterator_t it; + if((section = database_get_data(database, KEY_VERSION_CONTROL, RECDB_OBJECT))) + chanserv_version_read(section); + if((section = database_get_data(database, KEY_NOTE_TYPES, RECDB_OBJECT))) for(it = dict_first(section); it; it = iter_next(it)) chanserv_note_type_read(iter_key(it), iter_data(it)); @@ -7352,6 +7396,11 @@ dict_iterator_t it; struct chanData *channel; + /* Version Control*/ + saxdb_start_record(ctx, KEY_VERSION_CONTROL, 1); + saxdb_write_int(ctx, KEY_VERSION_NUMBER, CHANSERV_DB_VERSION); + saxdb_end_record(ctx); + /* Notes */ saxdb_start_record(ctx, KEY_NOTE_TYPES, 1); for(it = dict_first(note_types); it; it = iter_next(it)) @@ -7544,6 +7593,7 @@ /*DEFINE_CHANNEL_OPTION(giveops); DEFINE_CHANNEL_OPTION(givehalfops); */ + DEFINE_CHANNEL_OPTION(voice); DEFINE_CHANNEL_OPTION(protect); DEFINE_CHANNEL_OPTION(enfmodes); DEFINE_CHANNEL_OPTION(enftopic); @@ -7568,12 +7618,12 @@ modcmd_register(chanserv_module, "set topic", chan_opt_defaulttopic, 1, 0, NULL); /* User options */ - DEFINE_USER_OPTION(noautoop); DEFINE_USER_OPTION(autoinvite); DEFINE_USER_OPTION(info); + DEFINE_USER_OPTION(autoop); /* Alias uset autovoice to uset autoop. */ - modcmd_register(chanserv_module, "uset noautovoice", user_opt_noautoop, 1, 0, NULL); + modcmd_register(chanserv_module, "uset autovoice", user_opt_autoop, 1, 0, NULL); note_types = dict_new(); dict_set_free_data(note_types, chanserv_deref_note_type); @@ -7584,6 +7634,7 @@ service_register(chanserv)->trigger = '!'; reg_chanmsg_func('\001', chanserv, chanserv_ctcp_check); } + saxdb_register("ChanServ", chanserv_saxdb_read, chanserv_saxdb_write); if(chanserv_conf.channel_expire_frequency) Index: x3/src/chanserv.h diff -u x3/src/chanserv.h:1.9 x3/src/chanserv.h:1.10 --- x3/src/chanserv.h:1.9 Fri Apr 22 23:40:44 2005 +++ x3/src/chanserv.h Tue May 3 23:30:32 2005 @@ -53,6 +53,7 @@ }; enum charOption { + chVoice, chProtect, chToys, chTopicRefresh, @@ -113,12 +114,14 @@ struct chanData *next; }; -#define USER_AUTO_OP 0x00000001 +#define USER_NOAUTO_OP 0x00000001 /* OLD; Not used at all.. */ #define USER_SUSPENDED 0x00000002 #define USER_AUTO_INVITE 0x00000004 -#define USER_FLAGS_SIZE 7 +#define USER_AUTO_OP 0x00000008 +#define USER_FLAGS_SIZE 15 +#define USER_FLAGS_DEFAULT USER_AUTO_OP -#define IsUserAutoOp(USER) (!((USER)->flags & USER_AUTO_OP)) +#define IsUserAutoOp(USER) ((USER)->flags & USER_AUTO_OP) #define IsUserSuspended(USER) ((USER)->flags & USER_SUSPENDED) #define IsUserAutoInvite(USER) ((USER)->flags & USER_AUTO_INVITE) Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.10 x3/src/chanserv.help:1.11 --- x3/src/chanserv.help:1.10 Fri Apr 22 23:40:44 2005 +++ x3/src/chanserv.help Tue May 3 23:30:32 2005 @@ -425,6 +425,7 @@ "SETTERS: Who may change channel settings (using $bSET$b).", "CTCPUSERS: Who is allowed to send CTCPs to the channel.", "CTCPREACTION: What happens when a disallowed CTCP is sent to the channel.", + "VOICE: Who should be auto-voiced in the channel.", "PROTECT: The protection level $b$C$b provides.", "TOYS: Toggles how $b$C$b will respond to toy commands (!8ball etc).", "TOPICREFRESH: Controls if (and how often) $b$C$b will reset the topic.", @@ -473,6 +474,12 @@ "If a topic mask is set, then a person may change the topic as long as it matches that mask $bor$b they have the above access.", "If no topic mask is set, then a person must have the above access to change the topic from the default.", "$uSee Also:$u set, set topic, set topicmask"); +"SET VOICE" ("/msg $C SET <#channel> VOICE <value>", + "This setting configures who $C auto-voices. Valid settings are:", + "$b0$b Noone will get voice", + "$b1$b PEONs will get voice (default).", + "$b2$b Everyone will get voice.", + "$uSee Also:$u set, uset autoop"); "SET PROTECT" ("/msg $C SET <#channel> PROTECT <value>", "This setting restricts the protection that $C enforces. Valid settings are:", "$b0$b Non-users and users will be protected from those of equal or lower access", @@ -545,9 +552,8 @@ "The $buset$b command allows you to toggle various channel user settings. With no arguments, it will print the current values of all channel user options.", "$bOptions:$b", "INFO: Sets the infoline that $C sends when you join the channel.", - "NOAUTOOP: Enable or disable $C automatically opping you upon joining or authenticating.", + "AUTOOP: Enable or disable $C automatically opping you upon joining or authenticating.", "AUTOINVITE: $C will invite you to this channel if you have access to and are not in when you authenticate if this setting is on.", - "NOTE: The NoAutoOp setting is equivalent to the !togop command in previous versions of X3.", "$uSee Also:$u set"); "USET INFO" ("/msg $C USET <#channel> INFO <info>", "This command will set a user defined information message to be displayed when you join the channel. Set to '*' to clear the message.", Index: x3/src/hash.h diff -u x3/src/hash.h:1.8 x3/src/hash.h:1.9 --- x3/src/hash.h:1.8 Sat Mar 12 12:13:14 2005 +++ x3/src/hash.h Tue May 3 23:30:32 2005 @@ -47,7 +47,7 @@ #define MODE_OPERSONLY 0x00080000 /* +O Opers only */ #define MODE_NOQUITMSGS 0x00100000 /* +Q suppress messages from quit notices */ #define MODE_NOAMSG 0x00200000 /* +T no multi-target messages */ -#define MODE_SSLONLY 0x00400000 /* +z ssl only */ +#define MODE_SSLONLY 0x00400000 /* +Z ssl only */ #define MODE_HALFOP 0x00800000 /* +h USER */ #define MODE_EXEMPT 0x01000000 /* +e exempt */ #define MODE_REMOVE 0x80000000 Index: x3/src/modcmd.help diff -u x3/src/modcmd.help:1.3 x3/src/modcmd.help:1.4 --- x3/src/modcmd.help:1.3 Sun Mar 6 19:51:24 2005 +++ x3/src/modcmd.help Tue May 3 23:30:32 2005 @@ -1,12 +1,35 @@ -"bind" ("/msg $S BIND <service> <bindname> <command> [additional args..]", - "Binds (adds) a command to an existing service. $bbindname$b is the name of the new command for the service. $bcommand$b may be one of:", - " CommandName To refer to a command on the same service.", - " ServiceNick.CommandName To refer to a command bound on a different service such as $O, $C, $N, etc.", - " *ModuleName.CommandName To bind a command directly from a module (note the asterisk before the module name).", - " *ModuleName.* To bind all commands from the named module, where ModuleName is one of OpServ, NickServ, ChanServ, modcmd, or others.", - "For simplicity, you cannot bind to a command that is itself an alias. Certain commands will not bound with the last form; you must bind them by name.", - "(A command binding is very similar to an alias, but only pays the speed penalty for alias expansion when there are additional arguments in the binding.)", - "If you want to be able to bind $bfoo bar$b as a command, you need to bind $bfoo$b to modcmd.joiner first.", +"bind" ("/msg $S BIND <ServiceNick> <BindName> [Nick|*Module.]<Command> [Arg [Arg[..]]]", + "Bind creates a command. ", + " $bServiceNick$b is which service the new command will work on.", + " $bBindName$b is the name of the new command you are making.", + " $bCommand$b To refer to a command on the same service.", + " $bNick$b To refer to a command on a different ", + " service such as $O, $C, $N, etc.", + " $b*Module$b To bind a command directly from a module such as", + " ChanServ, OpServ, NickServ, modcmd, etc", + " (note the asterisk before the module name).", + " $barg(s)$b Can be anything, or you can use $$1 $$2 $$3 etc", + " which will be replaced with the arguments passed", + " to the command. Use a - after ($$2-) to indicate", + " that argument and all arguments after it.", + "$b$b", + "There is a special case to load ALL commands from a module:", + "/msg $S bind <serviceNick> * *<Module>.* ", + " 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.", + "$b$b", + "For simplicity, you cannot bind to a command that is an alias.", + "$b$b", + "If you want to bind $bfoo bar$b as a command, bind $bfoo$b to $b*modcmd.joiner$b first, unless foo is a builtin command such as uset, in which case use '\\' to escape the space (example: $bbind x3 uset\ autoop x3.uset\ autoop$b)", + "$b$b", + "$uExamples$u", + " bind X3 autoop *chanserv.uset\\ autoop", + " bind O3 murder o3.trace gline nick $$1 duration 1m reason $$2-", + " bind X3 * *chanserv.*", + "$b$b", "$uSee also:$u unbind, joiner"); "commands" "${index}"; Index: x3/src/proto-p10.c diff -u x3/src/proto-p10.c:1.14 x3/src/proto-p10.c:1.15 --- x3/src/proto-p10.c:1.14 Wed Apr 20 07:39:48 2005 +++ x3/src/proto-p10.c Tue May 3 23:30:32 2005 @@ -2237,6 +2237,7 @@ 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 'z': if (!(flags & MCP_REGISTERED)) { do_chan_mode(MODE_REGISTERED); @@ -2414,8 +2415,7 @@ 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'); #undef DO_MODE_CHAR if (change->modes_clear & channel->modes & MODE_KEY) mod_chanmode_append(&chbuf, 'k', channel->key); @@ -2466,8 +2466,7 @@ 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'); #undef DO_MODE_CHAR if(change->modes_set & MODE_KEY) mod_chanmode_append(&chbuf, 'k', change->new_key); @@ -2535,8 +2534,7 @@ 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'); #undef DO_MODE_CHAR } if (change->modes_set) { @@ -2559,8 +2557,7 @@ 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'); #undef DO_MODE_CHAR switch (change->modes_set & (MODE_KEY|MODE_LIMIT)) { case MODE_KEY|MODE_LIMIT: @@ -2615,6 +2612,7 @@ case 'T': remove |= MODE_NOAMSG; break; case 'O': remove |= MODE_OPERSONLY; break; case 'z': remove |= MODE_REGISTERED; break; + case 'Z': remove |= MODE_SSLONLY; break; } } ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-04 23:28:28
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-04 23:28:20 UTC Modified files: ChangeLog.X3 src/chanserv.c src/chanserv.h src/hash.c src/hash.h src/nickserv.c src/proto-p10.c Log message: adduser_pending feature added. ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.24 x3/ChangeLog.X3:1.25 --- x3/ChangeLog.X3:1.24 Tue May 3 23:30:29 2005 +++ x3/ChangeLog.X3 Wed May 4 16:28:06 2005 @@ -3,6 +3,22 @@ 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. + + * src/chanserv.h: adduser pending + + * src/hash.c: adduser pending + + * src/hash.h: adduser pending, and increased maxbans to 128 from 45. + + * src/nickserv.c: adduser pending cleanup and activation code + + * src/proto-p10.c: adduser pending cleanup code + +2005-05-04 Alex Schumann <ru...@af...> + * src/chanserv.c: changed uset noautoop to uset autoop (removed double negitive). Added set voice to provide control over use of voice. Implimented a basic chanserv db version control system for upgrading @@ -17,7 +33,7 @@ * src/proto-p10.c: Added Z (sslonly) support back in - * UPGRADE: created file to document upgrading procedures needed + * UPGRADE: created file to document upgrading procedures 2005-04-23 Alex Schumann <ru...@af...> * src/chanserv.c: removed settings: oplevel, halfoplevel, and @@ -146,5 +162,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.24 $" +#define CVS_VERSION "$Revision: 1.25 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.24 x3/src/chanserv.c:1.25 --- x3/src/chanserv.c:1.24 Tue May 3 23:30:31 2005 +++ x3/src/chanserv.c Wed May 4 16:28:08 2005 @@ -195,6 +195,11 @@ { "CSMSG_TRIMMED_USERS", "Trimmed $b%d users$b with access from %d to %d from the %s user list who were inactive for at least %s." }, { "CSMSG_INCORRECT_ACCESS", "%s has access $b%s$b, not %s." }, { "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_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." }, { "CSMSG_NO_SELF_CLVL", "You cannot change your own access." }, @@ -502,6 +507,8 @@ int off_channel; static dict_t plain_dnrs, mask_dnrs, handle_dnrs; static struct log_type *CS_LOG; +struct adduserPending* adduser_pendings = NULL; +unsigned int adduser_pendings_count = 0; static struct { @@ -1219,6 +1226,110 @@ unregister_channel(channel, "lost all users."); } +static struct adduserPending* +add_adduser_pending(struct chanNode *channel, struct userNode *user, int level) +{ + struct adduserPending *ap; + ap = calloc(1,sizeof(struct adduserPending)); + ap->channel = channel; + ap->user = user; + ap->level = level; + ap->created = time(NULL); + + /* ap->prev defaults to NULL already.. */ + ap->next = adduser_pendings; + if(adduser_pendings) + adduser_pendings->prev = ap; + adduser_pendings = ap; + adduser_pendings_count++; + return(ap); +} + +static void +del_adduser_pending(struct adduserPending *ap) +{ + if(ap->prev) + ap->prev->next = ap->next; + else + adduser_pendings = ap->next; + + if(ap->next) + ap->next->prev = ap->prev; + free(ap); +} + +static void expire_adduser_pending(); + +/* find_adduser_pending(channel, user) will find an arbitrary record + * from user, channel, or user and channel. + * if user or channel are NULL, they will match any records. + */ +static struct adduserPending* +find_adduser_pending(struct chanNode *channel, struct userNode *user) +{ + struct adduserPending *ap; + + expire_adduser_pending(); /* why not here.. */ + + if(!channel && !user) /* 2 nulls matches all */ + return(adduser_pendings); + for(ap = adduser_pendings;ap;ap = ap->next) + { + if((channel == ap->channel && (user == NULL || user == ap->user)) || (user==ap->user && channel==NULL)) + return ap; + } + return NULL; +} + + +/* Remove all pendings for a user or channel + * + * called in nickserv.c DelUser() and proto-* unregister_channel() + */ +void +wipe_adduser_pending(struct chanNode *channel, struct userNode *user) +{ + struct adduserPending *ap; + + /* So this is a bit wastefull, i hate dealing with linked lists. + * if its a problem we'll rewrite it right */ + while((ap = find_adduser_pending(channel, user))) { + del_adduser_pending(ap); + } +} + +/* Called from nickserv.c cmd_auth after someone auths */ +void +process_adduser_pending(struct userNode *user) +{ + struct adduserPending *ap; + while((ap = find_adduser_pending(NULL, user))) + { + struct userData *actee; + actee = add_channel_user(ap->channel->channel_info, ap->user->handle_info, ap->level, 0, NULL); + scan_user_presence(actee, NULL); + del_adduser_pending(ap); + } +} + +static void +expire_adduser_pending() +{ + struct adduserPending *ap, *ap_next; + ap = adduser_pendings; + while(ap) + { + if((ap->created + ADDUSER_PENDING_EXPIRE) < time(NULL)) + { /* expire it */ + ap_next = ap->next; /* save next */ + del_adduser_pending(ap); /* free and relink */ + ap = ap_next; /* advance */ + } + else + ap = ap->next; + } +} + static void expire_ban(void *data); static struct banData* @@ -1336,6 +1447,7 @@ - Channel users. - Channel bans. - Channel suspension data. + - adduser_pending data. - Timeq entries. (Except timed bans, which are handled elsewhere.) */ @@ -1351,6 +1463,8 @@ mod_chanmode_announce(chanserv, channel->channel, &change); } + wipe_adduser_pending(channel->channel, NULL); + while(channel->users) del_channel_user(channel->users, 0); @@ -2321,7 +2435,30 @@ } if(!(handle = modcmd_get_handle_info(user, argv[1]))) + { + // 'kevin must first authenticate with AuthServ.' is sent to user + struct userNode *unode; + unode = GetUserH(argv[1]); /* find user struct by nick */ + if(unode) + { + if(find_adduser_pending(channel, unode)) { + reply("CSMSG_ADDUSER_PENDING_ALREADY", channel->name); + } + else { + if(IsInChannel(channel, unode)) { + reply("CSMSG_ADDUSER_PENDING"); + add_adduser_pending(channel, unode, access); + send_message_type(1,unode, chanserv, "CSMSG_ADDUSER_PENDING_TARGET", user->nick, channel->name); + } + /* this results in user must auth AND not in chan errors. too confusing.. + else { + reply("CSMSG_ADDUSER_PENDING_NOTINCHAN", channel->name); + } + */ + } + } return 0; + } if((actee = GetTrueChannelAccess(channel->channel_info, handle))) { @@ -3649,8 +3786,6 @@ lData.table.contents[matches] = ary; /* ary[0] = strtab(uData->access);*/ ary[0] = user_level_name_from_level(uData->access); - /* TODO: replace above with func that returns static string - * of userlevel for that level. eg OP/MANAGER etc. -rubin */ ary[1] = strtab(uData->access); ary[2] = uData->handle->handle; if(uData->present) @@ -3678,6 +3813,14 @@ return 1; } +static CHANSERV_FUNC(cmd_pending) +{ + struct adduserPending *ap; + for(ap = adduser_pendings;ap;ap = ap->next) + reply("CSMSG_ADDUSER_PENDING_LIST", ap->channel->name, ap->user->nick); + return 1; +} + static CHANSERV_FUNC(cmd_users) { return cmd_list_users(CSFUNC_ARGS, 1, UL_OWNER); @@ -7479,6 +7622,8 @@ 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); @@ -7491,6 +7636,8 @@ DEFINE_COMMAND(createnote, 5, 0, "level", "800", NULL); DEFINE_COMMAND(removenote, 2, 0, "level", "800", NULL); + DEFINE_COMMAND(pending, 1, MODCMD_REQUIRE_AUTHED, "flags", "+helping", NULL); + DEFINE_COMMAND(unregister, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+loghostmask", NULL); DEFINE_COMMAND(merge, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "access", "owner", NULL); Index: x3/src/chanserv.h diff -u x3/src/chanserv.h:1.10 x3/src/chanserv.h:1.11 --- x3/src/chanserv.h:1.10 Tue May 3 23:30:32 2005 +++ x3/src/chanserv.h Wed May 4 16:28:09 2005 @@ -72,11 +72,15 @@ #define CHANNEL_PEON_INVITE 0x00000080 /* (1 << 7) - DEPRECATED */ #define CHANNEL_OFFCHANNEL 0x00000100 /* (1 << 8) */ #define CHANNEL_HOP_ALL 0x00000200 /* (1 << 9) */ - /* Flags with values over 0x20000000 or (1 << 29) will not work * because chanData.flags is a 30-bit field. */ +/* how many seconds a pending adduser will wait for a user + * to get auth or register + */ +#define ADDUSER_PENDING_EXPIRE 7200 /* 2 hours */ + #define IsProtected(x) ((x)->flags & CHANNEL_NODELETE) #define IsSuspended(x) ((x)->flags & CHANNEL_SUSPENDED) #define IsOffChannel(x) (((x)->flags & CHANNEL_OFFCHANNEL) && (off_channel > 1)) @@ -144,6 +148,17 @@ struct userData *u_next; }; +struct adduserPending +{ + struct chanNode *channel; + struct userNode *user; + int level; + time_t created; + + struct adduserPending *prev; + struct adduserPending *next; +}; + struct banData { char mask[NICKLEN + USERLEN + HOSTLEN + 3]; @@ -187,5 +202,7 @@ void do_math(char *Buffer, char *Math); char* user_level_name_from_level(int level); +void process_adduser_pending(struct userNode *user); +void wipe_adduser_pending(struct chanNode *channel, struct userNode *user); #endif Index: x3/src/hash.c diff -u x3/src/hash.c:1.8 x3/src/hash.c:1.9 --- x3/src/hash.c:1.8 Sat Mar 12 12:13:14 2005 +++ x3/src/hash.c Wed May 4 16:28:09 2005 @@ -757,6 +757,33 @@ return mn; } +struct userNode *IsInChannel(struct chanNode *channel, struct userNode *user) +{ + unsigned int n; + struct modeNode *mn = NULL; + + verify(channel); + verify(channel->members.list); + verify(user); + verify(user->channels.list); + if (channel->members.used < user->channels.used) { + for (n=0; n<channel->members.used; n++) { + verify(channel->members.list[n]); + if (user == channel->members.list[n]->user) { + return(user); + } + } + } else { + for (n=0; n<user->channels.used; n++) { + verify(user->channels.list[n]); + if (channel == user->channels.list[n]->channel) { + return(user); + } + } + } + return NULL; +} + DEFINE_LIST(userList, struct userNode*) DEFINE_LIST(modeList, struct modeNode*) DEFINE_LIST(banList, struct banNode*) Index: x3/src/hash.h diff -u x3/src/hash.h:1.9 x3/src/hash.h:1.10 --- x3/src/hash.h:1.9 Tue May 3 23:30:32 2005 +++ x3/src/hash.h Wed May 4 16:28:09 2005 @@ -104,7 +104,7 @@ #define CHANNELLEN 200 #define MAXMODEPARAMS 6 -#define MAXBANS 45 +#define MAXBANS 128 #define MAXEXEMPTS 45 /* IDLEN is 6 because it takes 5.33 Base64 digits to store 32 bytes. */ @@ -269,6 +269,7 @@ typedef int (*topic_func_t)(struct userNode *who, struct chanNode *chan, const char *old_topic); void reg_topic_func(topic_func_t handler); void SetChannelTopic(struct chanNode *channel, struct userNode *user, const char *topic, int announce); +struct userNode *IsInChannel(struct chanNode *channel, struct userNode *user); void init_structs(void); Index: x3/src/nickserv.c diff -u x3/src/nickserv.c:1.23 x3/src/nickserv.c:1.24 --- x3/src/nickserv.c:1.23 Sat Apr 23 10:48:34 2005 +++ x3/src/nickserv.c Wed May 4 16:28:10 2005 @@ -1320,6 +1320,7 @@ */ SyncLog("REGISTER %s %s %s %s", hi->handle, syncpass, email_addr ? email_addr : "0", user->info); } + process_adduser_pending(user); return 1; } @@ -1791,6 +1792,8 @@ if (hi->passwd[0] != '$') cryptpass(passwd, hi->passwd); reply("NSMSG_AUTH_SUCCESS"); + + process_adduser_pending(user); argv[pw_arg] = "****"; return 1; } Index: x3/src/proto-p10.c diff -u x3/src/proto-p10.c:1.15 x3/src/proto-p10.c:1.16 --- x3/src/proto-p10.c:1.15 Tue May 3 23:30:32 2005 +++ x3/src/proto-p10.c Wed May 4 16:28:10 2005 @@ -2079,6 +2079,9 @@ /* 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); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-04 23:55:27
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-04 23:55:20 UTC Modified files: src/nickserv.help Log message: nickserv register and set help improvements ---------------------- diff included ---------------------- Index: x3/src/nickserv.help diff -u x3/src/nickserv.help:1.9 x3/src/nickserv.help:1.10 --- x3/src/nickserv.help:1.9 Wed Apr 20 07:39:48 2005 +++ x3/src/nickserv.help Wed May 4 16:55:10 2005 @@ -406,19 +406,22 @@ "REGISTER" { "0: /services/nickserv/email_required" ( "/msg $N@$s REGISTER <account> <password> <email>", - "Registers a specified account with $b$N$b, adding your current user@host to your new account. You must use the same password with $bauth$b to authenticate to your account.", - "An email will be sent to the email address you give containing a cookie that will let you activate your account. Once you have that cookie, you must use the $bcookie$b command to be able to use your account.", + "Register is the command to register an account with $b$N$b. Later, you can use your account and password with $bauth$b to authenticate to your account.", + "Having an account provides a single login identity for use with $b$C$b. + "Email activation is required: An email will be sent to the email address you give containing a cookie that will let you activate your account. Once you have that cookie email, use the $bcookie$b command to activate your account.", "$uSee Also:$u auth, unregister" ); "1: /services/nickserv/email_enabled" ( "/msg $N@$s REGISTER <account> <password> [email]", - "Registers a specified account with $b$N$b, adding your current user@host to your new account. You must use the same password with $bauth$b to authenticate to your account.", - "If you specify an email address, an email will be sent to it containing a cookie that will let you activate your account. Once you have that cookie, you must use the $bcookie$b command to be able to use your account.", + "Register is the command to register an account with $b$N$b. Later, you can use your account and password with $bauth$b to authenticate to your account.", + "Having an account provides a single login identity for use with $b$C$b. + "Email activation is not required: But, if you specify an email address, an email will be sent to it containing a cookie that will let you activate your account. Once you have that cookie, use the $bcookie$b command to activate your account.", "$uSee Also:$u auth, unregister" ); "2: !/services/nickserv/email_enabled" ( "/msg $N@$s REGISTER <account> <password>", - "Registers a specified account with $b$N$b, adding your current user@host to your new account. You must use the same password with $bauth$b to authenticate to your account.", + "Register is the command to register an account with $b$N$b. Later, you can use your account and password with $bauth$b to authenticate to your account.", + "Having an account provides a single login identity for use with $b$C$b. "$uSee Also:$u auth, unregister" ); }; @@ -432,10 +435,11 @@ "$bINFO$b: Your infoline for $b$N$b (which can be viewed with the $baccountinfo$b command).", "$bLANGUAGE$b: Your preferred language for private messages from the services.", "$bPRIVMSG$b: If set, $b$N$b and $b$C$b will send text to you using PRIVMSGs rather than NOTICEs.", - "$bSTYLE$b: The style you want X3 to use for channel userlists it sends you. $bSTYLE$b can be either $bDef$b (default) or $bZoot$b.", "$bTABLEWIDTH$b: Sets the width for wrapping table-formatted text. (Use 0 for the default.)", "$bWIDTH$b: The width you want X3 to wrap text it sends you. (Use 0 for the default.)", "$bMAXLOGINS$b: The number of users that can log into your account at once. (Use 0 for the default.)", + "$bTITLE$b: A title set on your account by network staff (affects hidden hosts).", + "$bEPITHET$b: An epithet set on your account by network staff (shows in whois).", "$bset$b with no arguments returns your current settings.", "$uSee Also:$u accountinfo, userinfo" ); @@ -448,10 +452,11 @@ "$bINFO$b: Your infoline for $b$N$b (which can be viewed with the $baccountinfo$b command).", "$bLANGUAGE$b: Your preferred language for private messages from the services.", "$bPRIVMSG$b: If set, $b$N$b and $b$C$b will send text to you using PRIVMSGs rather than NOTICEs.", - "$bSTYLE$b: The style you want X3 to use for channel userlists it sends you. $bSTYLE$b can be either $bDef$b (default) or $bZoot$b.", "$bTABLEWIDTH$b: Sets the width for wrapping table-formatted text. (Use 0 for the default.)", "$bWIDTH$b: The width you want X3 to wrap text it sends you. (Use 0 for the default.)", "$bMAXLOGINS$b: The number of users that can log into your account at once. (Use 0 for the default.)", + "$bTITLE$b: A title set on your account by network staff (affects hidden hosts).", + "$bEPITHET$b: An epithet set on your account by network staff (shows in whois).", "$bset$b with no arguments returns your current settings.", "$uSee Also:$u accountinfo, nickinfo, userinfo" ); @@ -463,10 +468,11 @@ "$bINFO$b: Your infoline for $b$N$b (which can be viewed with the $baccountinfo$b command).", "$bLANGUAGE$b: Your preferred language for private messages from the services.", "$bPRIVMSG$b: If set, $b$N$b and $b$C$b will send text to you using PRIVMSGs rather than NOTICEs.", - "$bSTYLE$b: The style you want X3 to use for channel userlists it sends you. $bSTYLE$b can be either $bDef$b (default) or $bZoot$b.", "$bTABLEWIDTH$b: Sets the width for wrapping table-formatted text. (Use 0 for the default.)", "$bWIDTH$b: The width you want X3 to wrap text it sends you. (Use 0 for the default.)", "$bMAXLOGINS$b: The number of users that can log into your account at once. (Use 0 for the default.)", + "$bTITLE$b: A title set on your account by network staff (affects hidden hosts).", + "$bEPITHET$b: An epithet set on your account by network staff (shows in whois).", "$bset$b with no arguments returns your current settings.", "$uSee Also:$u accountinfo, userinfo" ); @@ -478,10 +484,11 @@ "$bINFO$b: Your infoline for $b$N$b (which can be viewed with the $baccountinfo$b command).", "$bLANGUAGE$b: Your preferred language for private messages from the services.", "$bPRIVMSG$b: If set, $b$N$b and $b$C$b will send text to you using PRIVMSGs rather than NOTICEs.", - "$bSTYLE$b: The style you want X3 to use for channel userlists it sends you. $bSTYLE$b can be either $bDef$b (default) or $bZoot$b.", "$bTABLEWIDTH$b: Sets the width for wrapping table-formatted text. (Use 0 for the default.)", "$bWIDTH$b: The width you want X3 to wrap text it sends you. (Use 0 for the default.)", "$bMAXLOGINS$b: The number of users that can log into your account at once. (Use 0 for the default.)", + "$bTITLE$b: A title set on your account by network staff (affects hidden hosts).", + "$bEPITHET$b: An epithet set on your account by network staff (shows in whois).", "$bset$b with no arguments returns your current settings.", "$uSee Also:$u accountinfo, nickinfo, userinfo" ); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-04 23:57:04
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-04 23:56:58 UTC Modified files: src/chanserv.help Log message: helpfile improvements ---------------------- diff included ---------------------- Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.11 x3/src/chanserv.help:1.12 --- x3/src/chanserv.help:1.11 Tue May 3 23:30:32 2005 +++ x3/src/chanserv.help Wed May 4 16:56:48 2005 @@ -284,8 +284,7 @@ "$uSee Also:$u say"); "EVENTS" ("/msg $C EVENTS <#channel> [limit [pattern]]", "Allows channel coowners to view a list of events related to their channel. If a pattern is provided, only events with a matching description will be displayed.", - "$bNote:$b You must specify a limit if you want to use a pattern to match against.", - "$uSee Also:$u last"); + "$bNote:$b You must specify a limit if you want to use a pattern to match against."); "EXPIRE" ("/msg $C EXPIRE", "Expires any channels that have not been visited within the configured duration. Channel registrations are automatically expired, so you only need to use this command if the duration has been changed.", "$uSee Also:$u unvisited"); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-05 00:03:42
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-05 00:03:33 UTC Modified files: ChangeLog.X3 src/nickserv.help Log message: help tweaks ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.25 x3/ChangeLog.X3:1.26 --- x3/ChangeLog.X3:1.25 Wed May 4 16:28:06 2005 +++ x3/ChangeLog.X3 Wed May 4 17:03:22 2005 @@ -17,6 +17,8 @@ * src/proto-p10.c: adduser pending cleanup code + * src/nickserv.help: improved set and register help + 2005-05-04 Alex Schumann <ru...@af...> * src/chanserv.c: changed uset noautoop to uset autoop (removed double @@ -162,5 +164,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.25 $" +#define CVS_VERSION "$Revision: 1.26 $" Index: x3/src/nickserv.help diff -u x3/src/nickserv.help:1.10 x3/src/nickserv.help:1.11 --- x3/src/nickserv.help:1.10 Wed May 4 16:55:10 2005 +++ x3/src/nickserv.help Wed May 4 17:03:23 2005 @@ -407,21 +407,21 @@ "0: /services/nickserv/email_required" ( "/msg $N@$s REGISTER <account> <password> <email>", "Register is the command to register an account with $b$N$b. Later, you can use your account and password with $bauth$b to authenticate to your account.", - "Having an account provides a single login identity for use with $b$C$b. + "Having an account provides a single login identity for use with $b$C$b.", "Email activation is required: An email will be sent to the email address you give containing a cookie that will let you activate your account. Once you have that cookie email, use the $bcookie$b command to activate your account.", "$uSee Also:$u auth, unregister" ); "1: /services/nickserv/email_enabled" ( "/msg $N@$s REGISTER <account> <password> [email]", "Register is the command to register an account with $b$N$b. Later, you can use your account and password with $bauth$b to authenticate to your account.", - "Having an account provides a single login identity for use with $b$C$b. + "Having an account provides a single login identity for use with $b$C$b.", "Email activation is not required: But, if you specify an email address, an email will be sent to it containing a cookie that will let you activate your account. Once you have that cookie, use the $bcookie$b command to activate your account.", "$uSee Also:$u auth, unregister" ); "2: !/services/nickserv/email_enabled" ( "/msg $N@$s REGISTER <account> <password>", "Register is the command to register an account with $b$N$b. Later, you can use your account and password with $bauth$b to authenticate to your account.", - "Having an account provides a single login identity for use with $b$C$b. + "Having an account provides a single login identity for use with $b$C$b.", "$uSee Also:$u auth, unregister" ); }; ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-05 00:15:13
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-05 00:15:06 UTC Modified files: ChangeLog.X3 src/chanserv.c src/nickserv.c Log message: woops :) ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.26 x3/ChangeLog.X3:1.27 --- x3/ChangeLog.X3:1.26 Wed May 4 17:03:22 2005 +++ x3/ChangeLog.X3 Wed May 4 17:14:56 2005 @@ -6,6 +6,7 @@ * 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. + Fixed email bug with adduser pending * src/chanserv.h: adduser pending @@ -164,5 +165,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.26 $" +#define CVS_VERSION "$Revision: 1.27 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.25 x3/src/chanserv.c:1.26 --- x3/src/chanserv.c:1.25 Wed May 4 16:28:08 2005 +++ x3/src/chanserv.c Wed May 4 17:14:56 2005 @@ -1303,6 +1303,8 @@ process_adduser_pending(struct userNode *user) { struct adduserPending *ap; + if(!user->handle_info) + return; /* not associated with an account */ while((ap = find_adduser_pending(NULL, user))) { struct userData *actee; Index: x3/src/nickserv.c diff -u x3/src/nickserv.c:1.24 x3/src/nickserv.c:1.25 --- x3/src/nickserv.c:1.24 Wed May 4 16:28:10 2005 +++ x3/src/nickserv.c Wed May 4 17:14:56 2005 @@ -1320,6 +1320,8 @@ */ SyncLog("REGISTER %s %s %s %s", hi->handle, syncpass, email_addr ? email_addr : "0", user->info); } + + /* this wont work if email is required .. */ process_adduser_pending(user); return 1; @@ -2057,6 +2059,8 @@ nickserv_eat_cookie(hi->cookie); + process_adduser_pending(user); + return 1; } ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-05 03:19:35
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-05 03:19:19 UTC Modified files: ChangeLog.X3 src/nickserv.c Log message: arch sync ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.27 x3/ChangeLog.X3:1.28 --- x3/ChangeLog.X3:1.27 Wed May 4 17:14:56 2005 +++ x3/ChangeLog.X3 Wed May 4 20:19:09 2005 @@ -14,7 +14,9 @@ * src/hash.h: adduser pending, and increased maxbans to 128 from 45. - * src/nickserv.c: adduser pending cleanup and activation code + * src/nickserv.c: adduser pending cleanup and activation code, + Arch sync (Avoid losing channel information when + replacing an account using the mergedb command.) * src/proto-p10.c: adduser pending cleanup code @@ -165,5 +167,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.27 $" +#define CVS_VERSION "$Revision: 1.28 $" Index: x3/src/nickserv.c diff -u x3/src/nickserv.c:1.25 x3/src/nickserv.c:1.26 --- x3/src/nickserv.c:1.25 Wed May 4 17:14:56 2005 +++ x3/src/nickserv.c Wed May 4 20:19:09 2005 @@ -3436,6 +3436,7 @@ struct string_list *masks, *slist; struct handle_info *hi; struct userNode *authed_users; + struct userData *channels; unsigned long int id; unsigned int ii; dict_t subdb; @@ -3449,10 +3450,13 @@ } if ((hi = get_handle_info(handle))) { authed_users = hi->users; + channels = hi->channels; hi->users = NULL; + hi->channels = NULL; dict_remove(nickserv_handle_dict, hi->handle); } else { authed_users = NULL; + channels = NULL; } hi = register_handle(handle, str, id); if (authed_users) { @@ -3462,6 +3466,7 @@ authed_users = authed_users->next_authed; } } + hi->channels = channels; masks = database_get_data(obj, KEY_MASKS, RECDB_STRING_LIST); hi->masks = masks ? string_list_copy(masks) : alloc_string_list(1); str = database_get_data(obj, KEY_MAXLOGINS, RECDB_QSTRING); ----------------------- End of diff ----------------------- |
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 ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-17 03:45:47
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-17 03:45:39 UTC Modified files: ChangeLog.X3 src/chanserv.help Log message: Missed a couple helf file changes ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.29 x3/ChangeLog.X3:1.30 --- x3/ChangeLog.X3:1.29 Thu May 5 17:30:51 2005 +++ x3/ChangeLog.X3 Mon May 16 20:45:28 2005 @@ -1,6 +1,11 @@ /*********************************************************************** X3 ChangeLog +2005-05-16 Alex Schumann <ru...@af...> + + * src/chanserv.help: Fixed a couple ban/lamer conversions i missed in + the help file. + 2005-05-04 Alex Schumann <ru...@af...> * src/modcmd.c: added a 'rebindall' command to assist with @@ -184,5 +189,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.29 $" +#define CVS_VERSION "$Revision: 1.30 $" Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.13 x3/src/chanserv.help:1.14 --- x3/src/chanserv.help:1.13 Thu May 5 17:30:51 2005 +++ x3/src/chanserv.help Mon May 16 20:45:28 2005 @@ -25,7 +25,7 @@ " $bOLIST$b Show all OPs of a channel.", " $bHLIST$b Show all HALFOPs of a channel.", " $bPLIST$b Show all PEONs of a channel.", - " $bBANS$b Show all $ulasting$u bans in a channel.", + " $bLAMERS$b Show all LAMERs of a channel.", " $bACCESS$b Check someone's access level in a channel.", " $bCLVL$b Change a person's access level in a channel.", " $bUSET$b Set a channel user's options (autos, info).", @@ -185,7 +185,7 @@ "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"); + "$uSee Also:$u llist, 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).", @@ -198,7 +198,7 @@ "$uSee Also:$u adduser, deluser, users"); "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. ", + "This command behaves in the exact same fashion as $bADDLAMER$b with the exception that the lamers 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>", @@ -334,7 +334,7 @@ "Deletes all peons with accounts matching the given pattern from the channel user list.", "$uSee Also:$u addpeon, mdelcoowner, mdelmanager, mdelop"); "MERGE" ("/msg $C MERGE <#channel> <destination>", - "Merges the source channel's registration, users, bans, and other data into the target channel. Users with access to both the source and target channels will retain the higher access level; if the access levels are the same, the more recent seen time is kept. Bans are also merged, with bans expiring later taking precedence.", + "Merges the source channel's registration, users, lamers, and other data into the target channel. Users with access to both the source and target channels will retain the higher access level; if the access levels are the same, the more recent seen time is kept. Lamers are also merged, with lamers expiring later taking precedence.", "$uSee Also:$u register, move, unregister"); "MLIST" ("/msg $C MLIST <#channel> [mask]", "This command lists all users of level $bManager$b on a channel's userlist. If a mask is supplied, only managers matching the mask will be shown.", @@ -526,7 +526,7 @@ "TOPIC" ("/msg $C TOPIC <#channel> [topic]", "Sets the current topic for the specified channel. If no topic is specified, then set the current topic to the default topic."); "TRIM" ("/msg $C TRIM <#channel> <target> <duration>", - "The trim command removes target objects inactive for more than a certain duration from a channel. The target must be a channel access level, a range of access levels (for example, \"300-399\"), \"users\" or \"bans\". The duration argument specifies the amount of time the target has been inactive for to be removed.", + "The trim command removes target objects inactive for more than a certain duration from a channel. The target must be a channel access level, a range of access levels (for example, \"300-399\"), \"users\" or \"lamers\". The duration argument specifies the amount of time the target has been inactive for to be removed.", "$uSee Also:$u durations"); "UNBAN" ("/msg $C UNBAN <#channel> <mask|nick>", "Unbans the specified nick or hostmask. If a nick is given, $b$C$b determines what hostmask(s) to unban.", ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-18 16:03:37
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-18 16:03:23 UTC Modified files: ChangeLog.X3 src/chanserv.help src/global.c src/global.help src/modcmd.c src/modcmd.h src/nickserv.c src/nickserv.help src/opserv.c src/opserv.help Log message: Fixed up the help system some more, and some other small changes. ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.30 x3/ChangeLog.X3:1.31 --- x3/ChangeLog.X3:1.30 Mon May 16 20:45:28 2005 +++ x3/ChangeLog.X3 Wed May 18 09:03:12 2005 @@ -1,6 +1,27 @@ /*********************************************************************** X3 ChangeLog +2005-05-18 Alex Schumann <ru...@af...> + + * src/modcmd.c: Fixed up the help system (again) + + * src/modcmd.h: Fixed up the help system (again) + + * src/global.c: Fixed syntax display + + * src/chanserv.help: Removed =---= formatting, fixed a few things. + + * src/nickserv.help: Removed =---= formatting, fixed a few things. + + * src/opserv.help: Removed =---= formatting, fixed a few things. + + * src/global.help: simplified index + + * src/nickserv.c: Changed message users get when their email is + already used for an account, fixed syntax help + + * src/opserv.c: fixed syntax help + 2005-05-16 Alex Schumann <ru...@af...> * src/chanserv.help: Fixed a couple ban/lamer conversions i missed in @@ -189,5 +210,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.30 $" +#define CVS_VERSION "$Revision: 1.31 $" Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.14 x3/src/chanserv.help:1.15 --- x3/src/chanserv.help:1.14 Mon May 16 20:45:28 2005 +++ x3/src/chanserv.help Wed May 18 09:03:13 2005 @@ -1,12 +1,16 @@ -"<INDEX>" ("=--------------- $b$C Help$b --------------=", +"<INDEX>" ( " Hello there! ", + " I'm $C, your handy channel services bot.", + " $b$b", " Please select the area you would like ", " help with from the list below. The ", " help system uses the format: ", " $b/MSG $C HELP <$bsubject$b>$b ", + " (In help, Words in <> represent required", + " paramiters. Words in [] are optional.)", " For example: $b/msg $C HELP UBM$b ", - " shows help with the UnBanMe command. ", - "=--------------------------------------=", + " shows help with the Un-Ban Me command. ", + "=---------------------------------------=", " GENERAL - How to use $C ", " USER - Commands to add and remove", " bans, ops and managers from ", @@ -16,9 +20,11 @@ " and topic.", " INFORMATION - Informative commands.", " OPER - Commands for IRC Operators.", - "=--------------------------------------=", + "$b$b", + "Also see $b/MSG $N HELP$b for getting", + "and maintaining your user account." ); -"USER" ("=-- $bUserlist Management Commands:$b ---=", +"USER" ("$bUserlist Management Commands:$b", " $bUSERS$b Show the channels userlist.", " $bCLIST$b Show all COOWNERs of a channel.", " $bMLIST$b Show all MANAGERs of a channel.", @@ -54,11 +60,10 @@ "$b$b", " $bMYACCESS$b Show all channels where you have access.", " $bDELETEME$b Delete YOURSELF from the userlist.", - " $bGIVEOWNERSHIP$b Give away ownership to another user.", - "=------------- End of Help ------------=" + " $bGIVEOWNERSHIP$b Give away ownership to another user." ); -"CHANNEL" ("=-------- $bChannel Commands:$b ---------=", +"CHANNEL" ("$bChannel Commands:$b", " $bSET$b Change various channel settings.", " $bTOPIC$b Set the current topic, or reset it to the default topic.", " $bMODE$b Change a channel mode.", @@ -87,20 +92,18 @@ " $bINVITE$b Admit a user to pass through +ib modes in your channel.", "$b$b", " $bINFO$b Show numerical information about the users in a channel.", - " $bEVENTS$b View a list of events relevant to a channel.", - "=------------- End of Help ------------=" + " $bEVENTS$b View a list of events relevant to a channel." ); -"INFORMATION" ("=------- $bInformative Commands:$b ------=", +"INFORMATION" ("$bInformative Commands:$b", " $bVERSION$b Check the current running version of $C.", " $bNETINFO$b Check current network-wide information.", " $bSTAFF$b Get a list of all the current staff.", " $bIRCOPS$b Get a list of all the current IRC operators.", " $bHELPERS$b Get a list of all the current support helpers.", " $bPEEK$b Reveal information on a channel's modes, topic and ops.", - " $bCOMMAND$b Display some information about a command.", - "=------------- End of Help ------------=" + " $bCOMMAND$b Display some information about a command." ); -"OPER" ("=-- $bHelper/IRC Operator commands:$b ---=", +"OPER" ("$bHelper/IRC Operator commands:$b", " $bGOD$b Turn security override on/off.", " $bOPCHAN$b Force $C to op itself in a channel.", "$b$b", @@ -124,11 +127,10 @@ " $bCREATENOTE$b Create a new note type.", " $bREMOVENOTE$b Remove an existing note type.", "*$bSAY$b Have $C say a message in a channel.", - "*$bEMOTE$b Equivalent to $C doing a /me in a channel.", - "=------------- End of Help ------------=" + "*$bEMOTE$b Equivalent to $C doing a /me in a channel." ); -"GENERAL" ("=----------- General Help -------------=", +"GENERAL" ( " NOTE: Before using $C or being added ", " to channel userlists, users must ", " register an account with $b$N$b. ", @@ -157,12 +159,11 @@ " expected as well. ", " See $b/msg $C HELP <COMMAND>$b for the ", " exact syntax of each command. ", - "=---------- For more info see ----------=", - " http://www.afternet.org/support ", - "=---------------------------------------=" + "=---------- For more info see: ---------=", + " http://www.afternet.org/support " ); -"LOGIN" ("=-- Logging In --=", +"LOGIN" ( " Please login using:", " /MSG $N AUTH <account> <password>", " or the shortcut:", Index: x3/src/global.c diff -u x3/src/global.c:1.3 x3/src/global.c:1.4 --- x3/src/global.c:1.3 Sat Mar 12 12:13:14 2005 +++ x3/src/global.c Wed May 18 09:03:13 2005 @@ -62,7 +62,7 @@ { NULL, NULL } }; -#define GLOBAL_SYNTAX() svccmd_send_help(user, global, cmd) +#define GLOBAL_SYNTAX() svccmd_send_help_brief(user, global, cmd) #define GLOBAL_FUNC(NAME) MODCMD_FUNC(NAME) struct userNode *global; Index: x3/src/global.help diff -u x3/src/global.help:1.2 x3/src/global.help:1.3 --- x3/src/global.help:1.2 Sun Mar 6 19:51:24 2005 +++ x3/src/global.help Wed May 18 09:03:13 2005 @@ -1,4 +1,4 @@ -"<INDEX>" ("$b$G Help$b", +"<INDEX>" ( "The $b$G$b service allows network administrators to manage and send important notices to users. It also allows users to retrieve, at once, all messages addressed to them.", "$bUser Commands:$b", " MESSAGES Sends you all messages addressed to your user class.", Index: x3/src/modcmd.c diff -u x3/src/modcmd.c:1.15 x3/src/modcmd.c:1.16 --- x3/src/modcmd.c:1.15 Thu May 5 17:30:51 2005 +++ x3/src/modcmd.c Wed May 18 09:03:13 2005 @@ -55,8 +55,11 @@ { "MCMSG_NO_CHANNEL_BEFORE", "You may not give a channel name before this command." }, { "MCMSG_NO_PLUS_CHANNEL", "You may not use a +channel with this command." }, { "MCMSG_COMMAND_ALIASES", "%s is an alias for: %s" }, -/* { "MCMSG_HELP_COMMAND_ALIAS_FOR", "$bALIAS FOR:$b %s" },*/ { "MCMSG_HELP_COMMAND_ALIAS", "$uAlias for:$u %s" }, + { "MCMSG_HELP_COMMAND_HEADER", "Command help for: $b%s$b" }, + { "MCMSG_HELP_TOPIC_HEADER", "Help topic: $b%s$b" }, + { "MCMSG_HELP_DIVIDER", "=---------------------------------------=" }, + { "MCMSG_HELP_FOOTER", "=------------- End of Help -------------=" }, { "MCMSG_COMMAND_BINDING", "%s is a binding of: %s" }, { "MCMSG_ALIAS_ERROR", "Error in alias expansion for %s; check the error log for details." }, { "MCMSG_INTERNAL_COMMAND", "$b%s$b is an internal command and cannot be called directly; please check command bindings." }, @@ -757,60 +760,18 @@ return 1; } -int -svccmd_send_help(struct userNode *user, struct userNode *bot, struct svccmd *cmd) { - char cmdname[MAXLEN]; - unsigned int nn; - int r; - /* Show command name (in bold). */ - for (nn=0; cmd->name[nn]; nn++) - cmdname[nn] = toupper(cmd->name[nn]); - cmdname[nn] = 0; - send_message_type(4, user, bot, "=--- $b%s$b ---=", cmdname); - - /* Show the help entry for the underlying command. */ - /* Lets not show help for a parent command, thats not what - * they asked for! - * return send_help(user, bot, cmd->command->parent->helpfile, cmd->command->name); - * TODO: We actually DO want to show the parent IF there is no other help. - */ - r = send_help(user, bot, cmd->command->parent->helpfile, cmd->name); - if(cmd->command->name && strcasecmp(cmd->command->name, cmd->name)) - { - send_message(user, bot, "MCMSG_HELP_COMMAND_ALIAS", cmd->command->name); - } - - /* If it's an alias, show what it's an alias for. */ - if (cmd->alias.used) { - char alias_text[MAXLEN]; - unsplit_string((char**)cmd->alias.list, cmd->alias.used, alias_text); - send_message(user, bot, "MCMSG_HELP_COMMAND_ALIAS", alias_text); - } - return r; -} - +/* First line (syntax usually) only help.. used for wrong param counts etc */ int svccmd_send_help_brief(struct userNode *user, struct userNode *bot, struct svccmd *cmd) { - char cmdname[MAXLEN]; - unsigned int nn; int r; - /* Show command name (in bold). */ - for (nn=0; cmd->name[nn]; nn++) - cmdname[nn] = toupper(cmd->name[nn]); - cmdname[nn] = 0; - /* Show the help entry for the underlying command. */ - /* Lets not show help for a parent command, thats not what - * they asked for! - * return send_help(user, bot, cmd->command->parent->helpfile, cmd->command->name); - * TODO: We actually DO want to show the parent IF there is no other help. - */ /* If it's an alias, show what it's an alias for. */ if (cmd->alias.used) { char alias_text[MAXLEN]; unsplit_string((char**)cmd->alias.list, cmd->alias.used, alias_text); send_message(user, bot, "MCMSG_COMMAND_ALIASES", cmd->name, cmd->command->name); } + /* Send the syntax line of help.. */ r = send_help_brief(user, bot, cmd->command->parent->helpfile, cmd->name); if(!r) { if(cmd->command->name) @@ -819,31 +780,59 @@ r = send_help_brief(user, bot, cmd->command->parent->helpfile, cmd->command->name); } } - return r; } - int -svccmd_send_help_2(struct userNode *user, struct service *service, const char *topic) { +svccmd_send_help(struct userNode *user, struct service *service, const char *topic) { struct module *module; struct svccmd *cmd; - unsigned int ii; - - /* If there is a command, send help for the command */ - if ((cmd = dict_find(service->commands, topic, NULL))) - return svccmd_send_help(user, service->bot, cmd); + char cmdname[MAXLEN]; + unsigned int nn; /* If there is no topic show the index */ if (!topic) topic = "<index>"; - /* look for the thing in the included help files */ - for (ii = 0; ii < service->modules.used; ++ii) { - module = service->modules.list[ii]; - if (!module->helpfile) - continue; - if (dict_find(module->helpfile->db, topic, NULL)) - return send_help(user, service->bot, module->helpfile, topic); + /* make heading str (uppercase) */ + for (nn=0; topic[nn]; nn++) + cmdname[nn] = toupper(topic[nn]); + cmdname[nn] = 0; + + /* If there is a command 'topic', send command help for the command */ + if ((cmd = dict_find(service->commands, topic, NULL))) + { + 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); + + /* Show if its an alias, or a binding of another command */ + if (cmd->alias.used) + { + 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); + } + else if(cmd->command->name && strcasecmp(cmd->command->name, cmd->name)) + { + send_message(user, service->bot, "MCMSG_HELP_COMMAND_ALIAS", cmd->command->name); + } + send_message(user, service->bot, "MCMSG_HELP_FOOTER"); + return true; + } + else /* look for topic in the help files loaded to this nick/service */ + { + /* Check for non command help in first primary help file, then + * check for help for this on another service and provide a tip */ + module = service->modules.list[0]; + if (module->helpfile && dict_find(module->helpfile->db, topic, NULL)) + { + + 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); + send_message(user, service->bot, "MCMSG_HELP_FOOTER"); + return true; + } } /* Otherwise say we cant find it */ send_message(user, service->bot, "MSG_TOPIC_UNKNOWN"); @@ -1276,7 +1265,7 @@ const char *topic; topic = (argc < 2) ? NULL : unsplit_string(argv+1, argc-1, NULL); - return svccmd_send_help_2(user, cmd->parent, topic); + return svccmd_send_help(user, cmd->parent, topic); } static MODCMD_FUNC(cmd_timecmd) { @@ -2388,7 +2377,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, "llist", "*chanserv.lamers", "$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")) { Index: x3/src/modcmd.h diff -u x3/src/modcmd.h:1.4 x3/src/modcmd.h:1.5 --- x3/src/modcmd.h:1.4 Thu Mar 17 22:19:43 2005 +++ x3/src/modcmd.h Wed May 18 09:03:13 2005 @@ -164,7 +164,7 @@ struct svccmd *service_bind_modcmd(struct service *service, struct modcmd *cmd, const char *name); /* Send help for a command to a user. */ -int svccmd_send_help(struct userNode *user, struct userNode *bot, struct svccmd *cmd); +int svccmd_send_help(struct userNode *user, struct service *service, const char *topic); /* .. and if somebody doesn't have a modcmd handy .. */ int svccmd_send_help_2(struct userNode *user, struct service *service, const char *topic); /* Send brief help for a command to a user. */ Index: x3/src/nickserv.c diff -u x3/src/nickserv.c:1.26 x3/src/nickserv.c:1.27 --- x3/src/nickserv.c:1.26 Wed May 4 20:19:09 2005 +++ x3/src/nickserv.c Wed May 18 09:03:13 2005 @@ -157,7 +157,7 @@ { "NSMSG_HANDLE_ACTIVATED", "Your account is now activated (with the password you entered when you registered). You are now authenticated to your account." }, { "NSMSG_PASSWORD_CHANGED", "You have successfully changed your password to what you requested with the $bresetpass$b command." }, { "NSMSG_EMAIL_PROHIBITED", "%s may not be used as an email address: %s" }, - { "NSMSG_EMAIL_OVERUSED", "There are already the maximum number of accounts associated with that email address." }, + { "NSMSG_EMAIL_OVERUSED", "That email address already has an account. Use RESETPASS if you forgot your password." }, { "NSMSG_EMAIL_SAME", "That is the email address already there; no need to change it." }, { "NSMSG_EMAIL_CHANGED", "You have successfully changed your email address." }, { "NSMSG_BAD_COOKIE_TYPE", "Your account had bad cookie type %d; sorry. I am confused. Please report this bug." }, @@ -1726,7 +1726,7 @@ pw_arg = 1; } else { reply("MSG_MISSING_PARAMS", argv[0]); - svccmd_send_help(user, nickserv, cmd); + svccmd_send_help_brief(user, nickserv, cmd); return 0; } if (!hi) { Index: x3/src/nickserv.help diff -u x3/src/nickserv.help:1.11 x3/src/nickserv.help:1.12 --- x3/src/nickserv.help:1.11 Wed May 4 17:03:23 2005 +++ x3/src/nickserv.help Wed May 18 09:03:13 2005 @@ -1,7 +1,6 @@ "<INDEX>" { "/services/nickserv/disable_nicks" { "/services/nickserv/email_enabled" ( - "=------------ $b$N Help$b -----------=", " $b$N$b is an authentication service,", " providing login identification for", " the network. $N is how you 'log in'", @@ -9,6 +8,14 @@ " with $C, and its how ircops are known", " to $O and $G.", " $b$b", + " The help system uses the format:", + " $b/MSG $N HELP <$bsubject$b>$b ", + " (In help, Words in <> represent required", + " paramiters. Words in [] are optional.)", + " For example: $b/msg $N HELP RESETPASS$b", + " shows help with the command to reset a ", + " lost password.", + " $b$b", " $b$N$b help categories:", " $bACCOUNT$b Account management.", " $bEMAIL$b Email based commands", @@ -19,11 +26,9 @@ "$b$b", " $b$N is $uNOT$u a NickServ$b! ", " see $b/msg $N HELP NOT NICKSERV$b ", - " for details ", - "=--------------------------------------=" + " for details " ); "!/services/nickserv/email_enabled" ( - "=------------ $b$N Help$b -----------=", " $b$N$b is an authentication service,", " providing login identification for", " the network. $N is how you 'log in'", @@ -38,13 +43,11 @@ "$b$b", " $b$N is $uNOT$u a NickServ$b! ", " see $b/msg $N HELP NOT NICKSERV$b ", - " for details ", - "=--------------------------------------=" + " for details " ); }; "!/services/nickserv/disable_nicks" { "/services/nickserv/email_enabled" ( - "=------------ $b$N Help$b -----------=", "$b$N Help$b", "$b$N$b is a nickname and authentication service, intended to serve as a central authentication point for all other network services. $b$C$b, $b$O$b, and $b$G$b all depend on $b$N$b to verify that users are valid. It also manages nickname ownership.", "$b$N$b command categories:", @@ -53,11 +56,9 @@ " EMAIL Email maintenance commands.", " INFORMATION Other functions.", " COMMANDS A list of all available commands.", - " OPER $N commands for IRC Operators.", - "=----------- End of Help --------------=" + " OPER $N commands for IRC Operators." ); "!/services/nickserv/email_enabled" ( - "=------------ $b$N Help$b -----------=", "$b$N Help$b", "$b$N$b is a nickname and authentication service, intended to serve as a central authentication point for all other network services. $b$C$b, $b$O$b, and $b$G$b all depend on $b$N$b to verify that users are valid. It also manages nickname ownership.", "$b$N$b command categories:", @@ -65,8 +66,7 @@ " NICK Nick management.", " INFORMATION Other functions.", " COMMANDS A list of all available commands.", - " OPER $N commands for IRC Operators.", - "=----------- End of Help --------------=" + " OPER $N commands for IRC Operators." ); }; }; @@ -75,7 +75,6 @@ "ACCOUNT" { "/services/nickserv/enable_ghost" ( - "=------------ $bACCOUNT Help$b -----------=", " Accounts are the way that $b$C$b ", " identifies you for access to channels. ", " They are slightly similar to IRC nicks, ", @@ -93,11 +92,9 @@ " $bDELMASK$b Remove a hostmask from your account.", " $bSET$b Set per-account options.", " $bGHOST$b Disconnects your old clients", - " $bACCOUNT FLAGS$b Definition for each account flag", - "=----------- End of Help --------------=" + " $bACCOUNT FLAGS$b Definition for each account flag" ); "!/services/nickserv/enable_ghost" ( - "=------------ $bACCOUNT Help$b -----------=", " Accounts are the way that $b$C$b ", " identifies you for access to channels. ", " They are slightly similar to IRC nicks, ", @@ -116,14 +113,12 @@ " $bDELMASK$b Remove a hostmask from your account.", " $bSET$b Set per-account options.", " $bRENAME$b Renames an account", - " $bACCOUNT FLAGS$b Definition for each account flag", - "=----------- End of Help --------------=" + " $bACCOUNT FLAGS$b Definition for each account flag" ); }; "NOT NICKSERV" { "/services/nickserv/disable_nicks" ( - "=------------ $bNOT NICKSERV$b ------------=", " $N is $unot$u a NickServ. On this network, ", " nicknames are not owned. $N allows ", " you to register a single account to ", @@ -131,20 +126,18 @@ " your nickname. ", " $b$N$b can tell you what ", " account a user is authenticated to ", - " using the $bUSERINFO$b command. ", - "=----------- End of Help --------------=" + " using the $bUSERINFO$b command. " ); }; -"INFORMATION" ("=------- $bInformational commands$b -------=", +"INFORMATION" ("$bInformational commands:$b", " $bACCOUNTINFO$b Displays information about an account.", " $bUSERINFO$b Display what account an online user is authenticated to.", " $bSTATUS$b $b$N$b status.", - " $bVERSION$b $b$N$b version information.", - "=----------- End of Help --------------=" + " $bVERSION$b $b$N$b version information." ); -"OPER" ("=---------- $bIRC Operator Help$b ---------=", +"OPER" ("$bIRC Operator Help:$b", " $bSEARCH$b Search accounts and apply an action.", " $bOSET$b Modify account details including password.", " $bRENAME$b Rename an account.", @@ -155,8 +148,7 @@ "*$bOUNREGNICK$b Remove a nick from someone's account.", " $bOADDMASK$b Add a mask to someone's account.", " $bODELMASK$b Remove a mask from someone's account.", - " $bMERGEDB$b Load a database into memory.", - "=----------- End of Help --------------=" + " $bMERGEDB$b Load a database into memory." ); Index: x3/src/opserv.c diff -u x3/src/opserv.c:1.16 x3/src/opserv.c:1.17 --- x3/src/opserv.c:1.16 Sat Mar 19 17:43:54 2005 +++ x3/src/opserv.c Wed May 18 09:03:13 2005 @@ -271,7 +271,7 @@ { NULL, NULL } }; -#define OPSERV_SYNTAX() svccmd_send_help(user, opserv, cmd) +#define OPSERV_SYNTAX() svccmd_send_help_brief(user, opserv, cmd) typedef int (*discrim_search_func)(struct userNode *match, void *extra); Index: x3/src/opserv.help diff -u x3/src/opserv.help:1.7 x3/src/opserv.help:1.8 --- x3/src/opserv.help:1.7 Thu May 5 17:30:51 2005 +++ x3/src/opserv.help Wed May 18 09:03:13 2005 @@ -1,4 +1,4 @@ -"<INDEX>" ("=------------------ $b$O Help$b ------------------=", +"<INDEX>" ( " $O provides Oper Services for the Network. ", " Please choose from the following categories: ", " $bGOD$b Enabling channel override. ", @@ -14,12 +14,11 @@ " $bSETTINGS$b View and temporarily change ", " config file settings. ", " $bADMIN$b Misc Administrator Commands. ", - " $bOWNERONLY$b $O operator only commands. ", - "=---------------- End of Help ----------------=" + " $bOWNERONLY$b $O operator only commands. " ); "COMMANDS" "${index}"; -"PUNISH" ("=------------- $bUser Punishments$b --------------=", +"PUNISH" ( " $bGLINE$b Global Ban a host.", " $bUNGLINE$b Remove a GLINE.", " $bBLOCK$b Gline by nickname.", @@ -27,36 +26,32 @@ " $bGTRACE$b Search the gline list.", " $b$b", " $bGAG$b Cause the services to ignore... ", - " $bUNGAG$b ...or unignore by mask.", - "=---------------- End of Help ----------------=" + " $bUNGAG$b ...or unignore by mask." ); -"INFORMATION" ("=----------- $bInformation Gathering$b -----------=", +"INFORMATION" ( " $bACCESS$b Shows a users $O access level.", " $bSTATS$b Show various lists and runtime info.", " $bWHOIS$b Show details about a user by nick.", " $bVERSION$b Show the $O version information.", " $bLOG$b View $O logs.", - " $bTRACES$b Powerfull commands for viewing or acting on lists of IRC objects.", - "=--------------- End of Help ----------------=" + " $bTRACES$b Powerfull commands for viewing or acting on lists of IRC objects." ); -"TRACES" ("=------------------ $bTraces$b ------------------=", +"TRACES" ( " $bTRACE$b Search current users and optionally apply an action.", " $bGTRACE$b Search current GLINEs and optionally remove them.", - " $bCSEARCH$b Search current channels.", - "=--------------- End of Help ----------------=" + " $bCSEARCH$b Search current channels." ); -"ALERTS" ("=------------------ $bAlerts$b ------------------=", +"ALERTS" ( " $bADDALERT$b Make $O automatically do something", " when users match a criteria.", " $bDELALERT$b Remove an alert.", - " $bSTATS ALERT$b See a listing of alerts. ", - "=--------------- End of Help ----------------=" + " $bSTATS ALERT$b See a listing of alerts. " ); -"CHANNEL" ("=------------- $bChannel Commands$b -------------=", +"CHANNEL" ( " $bOP$b Op someone.", " $bDEOP$b Deop someone.", " $bVOICE$b Voice someone.", @@ -75,26 +70,23 @@ " $bINVITE$b Invite someone to a channel.", " $bINVITEME$b Invite yourself to a channel.", " $bCLEARBANS$b Cear all bans from a channel.", - " $bCLEARMODES$b Clear all modes from a channel.", - "=--------------- End of Help ----------------=" + " $bCLEARMODES$b Clear all modes from a channel." ); -"CLONES" ("=-------------- $bClone handling$b --------------=", +"CLONES" ( " $bADDTRUST$b Add a clone limit exemption for a host.", " $bDELTRUST$b Remove a clone exemption.", " $bEDITTRUST$b Modify a clone exemption.", " $bquery services/opserv/untrusted_max$b", - " View the clone kill limit", - "=--------------- End of Help ----------------=" + " View the clone kill limit" ); -"SETTINGS" ("=----------------- $bSettings$b -----------------=", +"SETTINGS" ( " $bQUERY$b Show a runtime config setting.", - " $bSET$b $uTemporarily$u change a runtime config setting.", - "=--------------- End of Help ----------------=" + " $bSET$b $uTemporarily$u change a runtime config setting." ); -"ADMIN" ("=---------- $bAdministrative Commands$b ---------=", +"ADMIN" ( " $bACCESS$b Modify someone's $O access level.", " $bCOMMAND$b Show details of a command.", " $bSHOWCOMMANDS$b List all commands and required access levels.", @@ -114,11 +106,10 @@ " $b$b", " $bREFRESHG$b Refresh the Glines.", " $bSETTIME$b Synchronize time across the network.", - " $bTIMECMD$b Time how long a command runs.", - "=--------------- End of Help ----------------=" + " $bTIMECMD$b Time how long a command runs." ); -"OWNERONLY" ("=------------- $bOwner Only Stuff$b -------------=", +"OWNERONLY" ( " $bWRITE$b Write out a database.", " $bWRITEALL$b Write out ALL databases.", " $bREOPEN$b Close and Re-Open the logs.", @@ -150,8 +141,7 @@ " $bDELEXEMPT$b Remove an exception of the illegal word list.", " $b$b", " $bDUMP$b Drop safetychecked server protocol to the server. ", - " $bRAW$b Draw raw server protocol to the server. (DANGEROUS!)", - "=--------------- End of Help ----------------=" + " $bRAW$b Drop raw server protocol to the server. (DANGEROUS!)" ); @@ -171,7 +161,7 @@ "$uSee Also:$u delalert, alert reaction, trace criteria" ); -"TIME NOTATION" ("=---------------- $bTime Notation$b ---------------=", +"TIME NOTATION" ( " Many commands require a duration perameter ", " which all use the same syntax: ", " 1s - 1 second ", @@ -183,8 +173,7 @@ " 1y - 1 year", " Times can be compounded such as: ", " 1m40s - 1 minute and 40 seconds ", - " 5h20m30s - 5 hours 20 minutes and 30 seconds ", - "=-----------------------------------------------=" + " 5h20m30s - 5 hours 20 minutes and 30 seconds " ); "ADDTRUST" ("/msg $O ADDTRUST <ip> <count> <duration> <reason>", ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-18 17:51:31
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-18 17:51:16 UTC Modified files: ChangeLog.X3 src/chanserv.help src/nickserv.help Log message: fixed spelling ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.31 x3/ChangeLog.X3:1.32 --- x3/ChangeLog.X3:1.31 Wed May 18 09:03:12 2005 +++ x3/ChangeLog.X3 Wed May 18 10:51:05 2005 @@ -10,8 +10,10 @@ * src/global.c: Fixed syntax display * src/chanserv.help: Removed =---= formatting, fixed a few things. + *spelling * src/nickserv.help: Removed =---= formatting, fixed a few things. + *spelling * src/opserv.help: Removed =---= formatting, fixed a few things. @@ -210,5 +212,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.31 $" +#define CVS_VERSION "$Revision: 1.32 $" Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.15 x3/src/chanserv.help:1.16 --- x3/src/chanserv.help:1.15 Wed May 18 09:03:13 2005 +++ x3/src/chanserv.help Wed May 18 10:51:06 2005 @@ -7,7 +7,7 @@ " help system uses the format: ", " $b/MSG $C HELP <$bsubject$b>$b ", " (In help, Words in <> represent required", - " paramiters. Words in [] are optional.)", + " parameters. Words in [] are optional.)", " For example: $b/msg $C HELP UBM$b ", " shows help with the Un-Ban Me command. ", "=---------------------------------------=", Index: x3/src/nickserv.help diff -u x3/src/nickserv.help:1.12 x3/src/nickserv.help:1.13 --- x3/src/nickserv.help:1.12 Wed May 18 09:03:13 2005 +++ x3/src/nickserv.help Wed May 18 10:51:06 2005 @@ -11,7 +11,7 @@ " The help system uses the format:", " $b/MSG $N HELP <$bsubject$b>$b ", " (In help, Words in <> represent required", - " paramiters. Words in [] are optional.)", + " parameters. Words in [] are optional.)", " For example: $b/msg $N HELP RESETPASS$b", " shows help with the command to reset a ", " lost password.", ----------------------- End of diff ----------------------- |
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 ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-24 22:16:30
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-24 22:16:23 UTC Modified files: ChangeLog.X3 src/modcmd.c src/modcmd.help Log message: Fixing help to search all bound helpfiles for a topic. ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.33 x3/ChangeLog.X3:1.34 --- x3/ChangeLog.X3:1.33 Wed May 18 11:37:33 2005 +++ x3/ChangeLog.X3 Tue May 24 15:16:12 2005 @@ -3,11 +3,23 @@ 2005-05-18 Alex Schumann <ru...@af...> + * src/modcmd.c: reed pointed out that modcmd non-command help wasnt + working, and pointed me to the opserv helpfiles command, which shows + what services search what help files. This fixes the help command to + search that list as it should. Still need to modify the 'default' + helpfile search bindigs because I dont think chanserv should respond + to help from opserv's db, etc. See opserv's 'helpfiles' command. + + * src/modcmd.help: clarified 'helpfiles' help. + +2005-05-18 Alex Schumann <ru...@af...> + * 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. + commands help if none exists. / Display no help for that command on + commands (instead of topic) * src/modcmd.h: Fixed up the help system (again) @@ -217,5 +229,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.33 $" +#define CVS_VERSION "$Revision: 1.34 $" Index: x3/src/modcmd.c diff -u x3/src/modcmd.c:1.17 x3/src/modcmd.c:1.18 --- x3/src/modcmd.c:1.17 Wed May 18 11:37:34 2005 +++ x3/src/modcmd.c Tue May 24 15:16:13 2005 @@ -57,6 +57,7 @@ { "MCMSG_COMMAND_ALIASES", "%s is an alias for: %s" }, { "MCMSG_HELP_COMMAND_ALIAS", "$uAlias for:$u %s" }, { "MCMSG_HELP_COMMAND_HEADER", "Command help for: $b%s$b" }, + { "MCMSG_HELP_COMMAND_UNKNOWN", "No help available for that command." }, { "MCMSG_HELP_TOPIC_HEADER", "Help topic: $b%s$b" }, { "MCMSG_HELP_DIVIDER", "=---------------------------------------=" }, { "MCMSG_HELP_FOOTER", "=------------- End of Help -------------=" }, @@ -788,7 +789,7 @@ struct module *module; struct svccmd *cmd; char cmdname[MAXLEN]; - unsigned int nn; + unsigned int nn, ii; int helpsent = 0; /* If there is no topic show the index */ @@ -825,24 +826,33 @@ } /* 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_COMMAND_UNKNOWN"); send_message(user, service->bot, "MCMSG_HELP_FOOTER"); return true; } else /* look for topic in the help files loaded to this nick/service */ { - /* Check for non command help in first primary help file, then - * check for help for this on another service and provide a tip */ - module = service->modules.list[0]; - if (module->helpfile && dict_find(module->helpfile->db, topic, NULL)) + /* Check for non command help in first primary help file, then next and so on */ + /* Note - we need to think about default bindings. see opserv.helpfiles */ + for(ii = 0; ii < service->modules.used; ii++) { - - send_message(user, service->bot, "MCMSG_HELP_TOPIC_HEADER", cmdname); - send_message(user, service->bot, "MCMSG_HELP_DIVIDER"); - 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; + module = service->modules.list[ii]; + if(!module->helpfile) + continue; + if(dict_find(module->helpfile->db, topic, NULL)) + { + if (module->helpfile && dict_find(module->helpfile->db, topic, NULL)) + { + + send_message(user, service->bot, "MCMSG_HELP_TOPIC_HEADER", cmdname); + send_message(user, service->bot, "MCMSG_HELP_DIVIDER"); + /* This should never fail but maybe if something is odd? */ + 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; + } + } } } /* Otherwise say we cant find it */ Index: x3/src/modcmd.help diff -u x3/src/modcmd.help:1.5 x3/src/modcmd.help:1.6 --- x3/src/modcmd.help:1.5 Thu May 5 17:30:51 2005 +++ x3/src/modcmd.help Tue May 24 15:16:13 2005 @@ -116,7 +116,7 @@ "helpfiles" ("/msg $S HELPFILES <service> [module list]", "With only a service nick, shows the helpfiles used by that service.", - "With a list of modules, sets the order that the service will look up non-command help entries.", + "Give a list of modules (seperated by spaces), to set the order that the service will look up non-command help entries.", "$uSee Also:$u bind, unbind"); "service add" ("/msg $S SERVICE ADD <nick> <hostname> <description>", ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-28 04:57:54
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-28 04:57:48 UTC Modified files: ChangeLog.X3 src/chanserv.c Log message: Fix some stuff with adduser pending ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.34 x3/ChangeLog.X3:1.35 --- x3/ChangeLog.X3:1.34 Tue May 24 15:16:12 2005 +++ x3/ChangeLog.X3 Fri May 27 21:57:38 2005 @@ -1,6 +1,13 @@ /*********************************************************************** X3 ChangeLog +2005-05-27 Alex Schumann <ru...@af...> + + * src/chanserv.c: make pending add check if the person is already on + the userlist before re-adding them (thx exec & reed for noticing this) + Fix capitalisation of I in pending notice. + + 2005-05-18 Alex Schumann <ru...@af...> * src/modcmd.c: reed pointed out that modcmd non-command help wasnt @@ -229,5 +236,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.34 $" +#define CVS_VERSION "$Revision: 1.35 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.28 x3/src/chanserv.c:1.29 --- x3/src/chanserv.c:1.28 Wed May 18 11:37:34 2005 +++ x3/src/chanserv.c Fri May 27 21:57:38 2005 @@ -195,7 +195,7 @@ { "CSMSG_TRIMMED_USERS", "Trimmed $b%d users$b with access from %d to %d from the %s user list who were inactive for at least %s." }, { "CSMSG_INCORRECT_ACCESS", "%s has access $b%s$b, not %s." }, { "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", "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_HEADER", "Users to add to channels pending logins:" }, /* Remove after testing? */ { "CSMSG_ADDUSER_PENDING_LIST", "Channel %s user %s" }, /* Remove after testing? */ @@ -1311,8 +1311,15 @@ while((ap = find_adduser_pending(NULL, user))) { struct userData *actee; - actee = add_channel_user(ap->channel->channel_info, ap->user->handle_info, ap->level, 0, NULL); - scan_user_presence(actee, NULL); + if(GetTrueChannelAccess(ap->channel->channel_info, ap->user->handle_info)) + { + /* Already on the userlist. do nothing*/ + } + else + { + actee = add_channel_user(ap->channel->channel_info, ap->user->handle_info, ap->level, 0, NULL); + scan_user_presence(actee, NULL); + } del_adduser_pending(ap); } } ----------------------- End of diff ----------------------- |
From: Reed L. <r3...@us...> - 2005-05-28 05:28:49
|
Committer : Reed Loden <r3...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-28 05:28:42 UTC Modified files: ChangeLog.X3 src/chanserv.c Log message: Grammar/spelling fixes, resync fixes, and incorrectly named message fix. ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.35 x3/ChangeLog.X3:1.36 --- x3/ChangeLog.X3:1.35 Fri May 27 21:57:38 2005 +++ x3/ChangeLog.X3 Fri May 27 22:28:31 2005 @@ -1,13 +1,18 @@ /*********************************************************************** X3 ChangeLog +2005-05-27 Reed Loden <re...@re...> + + * src/chanserv.c: Fixed an incorrectly named message. Fixed some + grammar issues in the message send to pending users. Fixed a + problem with some of the resync code. + 2005-05-27 Alex Schumann <ru...@af...> * src/chanserv.c: make pending add check if the person is already on the userlist before re-adding them (thx exec & reed for noticing this) Fix capitalisation of I in pending notice. - 2005-05-18 Alex Schumann <ru...@af...> * src/modcmd.c: reed pointed out that modcmd non-command help wasnt @@ -236,5 +241,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.35 $" +#define CVS_VERSION "$Revision: 1.36 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.29 x3/src/chanserv.c:1.30 --- x3/src/chanserv.c:1.29 Fri May 27 21:57:38 2005 +++ x3/src/chanserv.c Fri May 27 22:28:32 2005 @@ -199,9 +199,9 @@ { "CSMSG_ADDUSER_PENDING_ALREADY", "He or she is already pending addition to %s once he/she auths with $b$N$b." }, { "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_FOOTER", "--------- 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_ADDUSER_PENDING_TARGET", "Channel Services bot here: %s would like to add you to my userlist in channel %s, but you are not authenticated to $b$N$b. Please authenticate now and you will be added. If you do not have an account, type /msg $N help register" }, { "CSMSG_CANNOT_TRIM", "You must include a minimum inactivity duration of at least 60 seconds to trim." }, { "CSMSG_NO_SELF_CLVL", "You cannot change your own access." }, @@ -4476,14 +4476,14 @@ } else if(uData && uData->access >= UL_HALFOP /*cData->lvlOpts[lvlGiveHalfOps]*/) { - if(!(mn->modes & MODE_HALFOP)) + if(mn->modes & MODE_CHANOP) { - changes->args[used].mode = MODE_HALFOP; + changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_CHANOP); changes->args[used++].u.member = mn; } - if(mn->modes & MODE_CHANOP) + if(!(mn->modes & MODE_HALFOP)) { - changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_CHANOP); + changes->args[used].mode = MODE_HALFOP; changes->args[used++].u.member = mn; } if(mn->modes & MODE_VOICE) @@ -4496,12 +4496,12 @@ { if(mn->modes & MODE_CHANOP) { - changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_VOICE); + changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_CHANOP); changes->args[used++].u.member = mn; } if(mn->modes & MODE_HALFOP) { - changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_VOICE); + changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_HALFOP); changes->args[used++].u.member = mn; } if(!(mn->modes & MODE_VOICE)) ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-05-28 05:41:31
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-05-28 05:41:25 UTC Modified files: ChangeLog.X3 src/chanserv.c Log message: Resync fix ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.36 x3/ChangeLog.X3:1.37 --- x3/ChangeLog.X3:1.36 Fri May 27 22:28:31 2005 +++ x3/ChangeLog.X3 Fri May 27 22:41:15 2005 @@ -1,6 +1,10 @@ /*********************************************************************** X3 ChangeLog +2005-05-27 Alex Schumann <ru...@af...> + + * src/chanserv.c: Resync working now + 2005-05-27 Reed Loden <re...@re...> * src/chanserv.c: Fixed an incorrectly named message. Fixed some @@ -241,5 +245,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.36 $" +#define CVS_VERSION "$Revision: 1.37 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.30 x3/src/chanserv.c:1.31 --- x3/src/chanserv.c:1.30 Fri May 27 22:28:32 2005 +++ x3/src/chanserv.c Fri May 27 22:41:15 2005 @@ -4478,7 +4478,7 @@ { if(mn->modes & MODE_CHANOP) { - changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_CHANOP); + changes->args[used].mode = MODE_REMOVE | MODE_CHANOP; changes->args[used++].u.member = mn; } if(!(mn->modes & MODE_HALFOP)) @@ -4486,22 +4486,24 @@ changes->args[used].mode = MODE_HALFOP; changes->args[used++].u.member = mn; } + /* why cant halfops keep voice if(mn->modes & MODE_VOICE) { changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_VOICE); changes->args[used++].u.member = mn; } + */ } else if(uData && uData->access >= UL_PEON /* cData->lvlOpts[lvlGiveVoice]*/) { if(mn->modes & MODE_CHANOP) { - changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_CHANOP); + changes->args[used].mode = MODE_REMOVE | MODE_CHANOP; changes->args[used++].u.member = mn; } if(mn->modes & MODE_HALFOP) { - changes->args[used].mode = MODE_REMOVE | (mn->modes & ~MODE_HALFOP); + changes->args[used].mode = MODE_REMOVE | MODE_HALFOP; changes->args[used++].u.member = mn; } if(!(mn->modes & MODE_VOICE)) ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-06-02 23:17:25
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-06-02 23:17:17 UTC Modified files: ChangeLog.X3 src/chanserv.c src/chanserv.help Log message: Improved usability of the REGISTER command, in preperation to make it usable by users ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.37 x3/ChangeLog.X3:1.38 --- x3/ChangeLog.X3:1.37 Fri May 27 22:41:15 2005 +++ x3/ChangeLog.X3 Thu Jun 2 16:16:56 2005 @@ -3,6 +3,12 @@ 2005-05-27 Alex Schumann <ru...@af...> + * src/chanserv.c: Improved usability of register command + + * src/chanserv.help: Improved usability of register command + +2005-05-27 Alex Schumann <ru...@af...> + * src/chanserv.c: Resync working now 2005-05-27 Reed Loden <re...@re...> @@ -245,5 +251,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.37 $" +#define CVS_VERSION "$Revision: 1.38 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.31 x3/src/chanserv.c:1.32 --- x3/src/chanserv.c:1.31 Fri May 27 22:41:15 2005 +++ x3/src/chanserv.c Thu Jun 2 16:16:57 2005 @@ -129,9 +129,11 @@ { "CSMSG_REG_SUCCESS", "You now have ownership of $b%s$b." }, { "CSMSG_PROXY_SUCCESS", "%s now has ownership of $b%s$b." }, { "CSMSG_ALREADY_REGGED", "$b%s$b is registered to someone else." }, - { "CSMSG_MUST_BE_OPPED", "You must be a channel operator in $b%s$b to register it." }, + { "CSMSG_MUST_BE_OPPED", "You must be a channel operator (+o) in $b%s$b to register it." }, { "CSMSG_PROXY_FORBIDDEN", "You may not register a channel for someone else." }, - { "CSMSG_OWN_TOO_MANY", "%s already owns enough channels (at least %d); use FORCE to override." }, + { "CSMSG_OWN_TOO_MANY", "%s already owns more than the limit of %d channels. Use FORCE to override." }, + { "CSMSG_YOU_OWN_TOO_MANY", "You already own more than the limit of %d channels. Ask a staff member for help." }, + { "CSMSG_ANOTHER_SERVICE", "Another service bot is in that channel already. Ask a staff member for help." }, /* Do-not-register channels */ { "CSMSG_NOT_DNR", "$b%s$b is not a valid channel name or *account." }, @@ -1887,6 +1889,8 @@ char *chan_name; unsigned int new_channel, force=0; struct do_not_register *dnr; + unsigned int n; + if(channel) { @@ -1902,8 +1906,7 @@ return 0; } - if(!IsHelping(user) - && (!(mn = GetUserMode(channel, user)) || !(mn->modes & MODE_CHANOP))) + if(!IsHelping(user) && (!(mn = GetUserMode(channel, user)) || !(mn->modes & MODE_CHANOP))) { reply("CSMSG_MUST_BE_OPPED", channel->name); return 0; @@ -1948,11 +1951,36 @@ return 0; force = (argc > (new_channel+2)) && !irccasecmp(argv[new_channel+2], "force"); dnr = chanserv_is_dnr(chan_name, handle); + + /* Check if they are over the limit.. */ + if((chanserv_get_owned_count(handle) >= chanserv_conf.max_owned) && !force) + { + reply("CSMSG_OWN_TOO_MANY", handle->handle, chanserv_conf.max_owned); + return 0; + } + } else { - handle = user->handle_info; + handle = user->handle_info; dnr = chanserv_is_dnr(chan_name, handle); + /* Check if they are over the limit.. */ + if((chanserv_get_owned_count(handle) >= chanserv_conf.max_owned) && !force) + { + reply("CSMSG_YOU_OWN_TOO_MANY", chanserv_conf.max_owned); + return 0; + } + /* Check if another service is in the channel */ + if(channel) + for(n = 0; n < channel->members.used; n++) + { + mn = channel->members.list[n]; + if((mn && mn->user && (mn->user->modes & FLAGS_SERVICE)) || IsLocal(mn->user)) + { + reply("CSMSG_ANOTHER_SERVICE"); + return 0; + } + } } if(dnr && !force) { @@ -1963,11 +1991,13 @@ return 0; } + /* now handled above for message specilization * if((chanserv_get_owned_count(handle) >= chanserv_conf.max_owned) && !force) { reply("CSMSG_OWN_TOO_MANY", handle->handle, chanserv_conf.max_owned); return 0; } + */ if(new_channel) channel = AddChannel(argv[1], now, NULL, NULL, NULL); Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.17 x3/src/chanserv.help:1.18 --- x3/src/chanserv.help:1.17 Wed May 18 11:37:34 2005 +++ x3/src/chanserv.help Thu Jun 2 16:17:07 2005 @@ -378,11 +378,20 @@ "PLIST" ("/msg $C PLIST <#channel>", "This command lists all users of level $bPeon$b on a channel's userlist. If a mask is supplied, only peons matching the mask will be shown.", "$uSee Also:$u addpeon, delpeon, mdelpeon, users"); -"REGISTER" ("/msg $C REGISTER <#channel> [user|*account] [force]", - "Registers a channel with $b$C$b, automatically granting owner access to the specified user. If no user is provided, $b$C$b gives owner access to the user executing the command.", - "If the registrar is on the network staff and provides the third argument, $bforce$b, it will allow a do-not-register channel to be registered anyway.", - "In addition, $bregister$b will only allow one user to own a certain number of channels without the $bforce$b argument.", - "$uSee Also:$u addowner, noregister, unregister"); + +"REGISTER" ( + "/msg $C REGISTER <#channel>", + "Registers a channel to you with $b$C$b. X3 will protect your channel, preserve your ownership of the channel, and provide handy features such as userlists and stats.", + "If the channel exists, you must have ops (+o) and there is a limit to the number of channels you may have at once.", + "Network staff see /MSG $C HELP STAFF REGISTER", + "$uSee Also:$u unregister, giveownership"); + +"STAFF REGISTER" ( + "/msg $C REGISTER <#channel> [user|*account] [force]", + "Registers a channel to the givin user with $b$C$b.", + "If staff provides the third argument, $bforce$b, it will allow the registration even if it is a do-not-register channel or ther register limit will be exceded.", + "$uSee Also:$u addowner, noregister, register, unregister"); + "REMOVENOTE" ("/msg $S REMOVENOTE <typename> [FORCE]", "Permanently deletes a note type. Without the argument $bFORCE$b, it will only delete an unused note type. With the argument $bFORCE$b, it will delete the note from all channels and then delete the note type.", "$uSee Also:$u createnote"); ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-06-02 23:46:03
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-06-02 23:45:55 UTC Modified files: ChangeLog.X3 src/chanserv.c Log message: Fixing a thing krobar noticed in unregister ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.38 x3/ChangeLog.X3:1.39 --- x3/ChangeLog.X3:1.38 Thu Jun 2 16:16:56 2005 +++ x3/ChangeLog.X3 Thu Jun 2 16:45:44 2005 @@ -3,7 +3,8 @@ 2005-05-27 Alex Schumann <ru...@af...> - * src/chanserv.c: Improved usability of register command + * src/chanserv.c: Improved usability of register command, fixed + unregister reply. * src/chanserv.help: Improved usability of register command @@ -251,5 +252,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.38 $" +#define CVS_VERSION "$Revision: 1.39 $" Index: x3/src/chanserv.c diff -u x3/src/chanserv.c:1.32 x3/src/chanserv.c:1.33 --- x3/src/chanserv.c:1.32 Thu Jun 2 16:16:57 2005 +++ x3/src/chanserv.c Thu Jun 2 16:45:44 2005 @@ -152,7 +152,7 @@ { "CSMSG_UNREG_SUCCESS", "$b%s$b has been unregistered." }, { "CSMSG_UNREG_NODELETE", "$b%s$b is protected from unregistration." }, { "CSMSG_CHAN_SUSPENDED", "$b$C$b access to $b%s$b has been temporarily suspended (%s)." }, - { "CSMSG_CONFIRM_UNREG", "To confirm this unregistration, you must use 'unregister %s'." }, + { "CSMSG_CONFIRM_UNREG", "To confirm this unregistration, you must use 'unregister %s %s'." }, /* Channel moving */ { "CSMSG_MOVE_SUCCESS", "Channel registration has been moved to $b%s$b." }, @@ -2089,7 +2089,7 @@ confirm_string = make_confirmation_string(uData); if((argc < 2) || strcmp(argv[1], confirm_string)) { - reply("CSMSG_CONFIRM_UNREG", confirm_string); + reply("CSMSG_CONFIRM_UNREG", channel->name, confirm_string); return 0; } } ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-06-22 21:58:58
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-06-22 21:58:50 UTC Modified files: ChangeLog.X3 src/tools.c src/chanserv.help Log message: DURATION fixes ---------------------- diff included ---------------------- Index: x3/ChangeLog.X3 diff -u x3/ChangeLog.X3:1.39 x3/ChangeLog.X3:1.40 --- x3/ChangeLog.X3:1.39 Thu Jun 2 16:45:44 2005 +++ x3/ChangeLog.X3 Wed Jun 22 14:58:31 2005 @@ -1,6 +1,12 @@ /*********************************************************************** X3 ChangeLog +2005-06-22 Alex Schumann <ru...@af...> + * src/chanserv.help: Improved DURATION help + + * src/tools.c: Changed 'M' duration to 30 days (not 31) as its + a better average. + 2005-05-27 Alex Schumann <ru...@af...> * src/chanserv.c: Improved usability of register command, fixed @@ -252,5 +258,5 @@ ***********************************************************************/ -#define CVS_VERSION "$Revision: 1.39 $" +#define CVS_VERSION "$Revision: 1.40 $" Index: x3/src/chanserv.help diff -u x3/src/chanserv.help:1.18 x3/src/chanserv.help:1.19 --- x3/src/chanserv.help:1.18 Thu Jun 2 16:17:07 2005 +++ x3/src/chanserv.help Wed Jun 22 14:58:40 2005 @@ -280,11 +280,24 @@ "DOWNALL" ("/msg $C DOWNALL", "Executes the $bdown$b command for each channel you have access to.", "$uSee Also:$u down, up, upall"); -"DURATIONS" ("[<n>y][<n>M][<n>w][<n>d][<n>h][<n>m][<n>[s]]", - "There is a standard syntax for durations that let you easily specify longer periods of time. A duration consists of one or more \"duration parts\", which are sequences of digits, separated by duration letters.", - "The valid duration letters are $by$b (for year, or 365 days), $bM$b (for month, or 31 days), $bw$b (for week, or 7 days), $bd$b (for day, or 24 hours), $bh$b (for hour, or 60 minutes), $bm$b (for minute, or 60 seconds), and $bs$b (for second). We know not all years are 365 days and not all months are 31 days, but we pretend they are for parsing durations.", - "If the last duration part does not have any letter to indicate the units, seconds are assumed.", - "$uExamples$u: 1y1M is 365 days plus 31 days; 1y1m is 365 days plus 1 minute; 1h30m45 is ninety minutes and forty-five seconds; and so forth."); +"DURATIONS" ( + "This is the syntax used for commands that require time durations. A time duration is made up of numbers and units. Multiple units may be used in a row.", + "The valid unit letters are:", + "$by$b - years (365 days)", + "$bM$b - months (30 days)", + "$bw$b - weeks (7 days)", + "$bd$b - days (24 hours)", + "$bh$b - hours (60 minutes)", + "$bm$b - minutes (60 seconds)", + "$bs$b - seconds", + "If the unit letter is not givin, seconds are assumed.", + "$b$b", + "$uExamples$u:", + "$b5d$b is 5 days.", + "$b1y2M$b is 1 year and 2 months (425 days.)", + "$b1d1h$b is 1 day and 1 hour (25 hours.)", + "$b1h25m30s$b is 1 hour, 25 minutes and 30 seconds." + ); "EMOTE" ("/msg $C EMOTE <#channel> <text>", "Makes $b$C$b send a CTCP ACTION message to the specified channel.", "$uSee Also:$u say"); Index: x3/src/tools.c diff -u x3/src/tools.c:1.11 x3/src/tools.c:1.12 --- x3/src/tools.c:1.11 Sat Mar 19 17:11:35 2005 +++ x3/src/tools.c Wed Jun 22 14:58:35 2005 @@ -588,7 +588,7 @@ { switch (type) { case 'y': return 365*24*60*60; - case 'M': return 31*24*60*60; + case 'M': return 30*24*60*60; case 'w': return 7*24*60*60; case 'd': return 24*60*60; case 'h': return 60*60; @@ -598,6 +598,10 @@ } } +/* This function is not entirely accurate as it does not take into account leap units + * or varying months. TODO: use proper dateadd functions to calculate real seconds + * from now for the units (eg 1M should be give us seconds till todays date next month) + */ unsigned long ParseInterval(const char *interval) { ----------------------- End of diff ----------------------- |
From: Alex S. <ru...@us...> - 2005-07-14 16:51:10
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x3 Commit time: 2005-07-14 16:51:02 UTC Modified files: src/nickserv.c Added files: README.CVS Log message: This CVS repository is no longer 'current'. Please switch to the SVN repository at http://forge.novell.com/modules/xfmod/svn/svnpage.php/evilnet/ (Added README file to this effect) ---------------------- diff included ---------------------- Index: x3/README.CVS diff -u /dev/null x3/README.CVS:1.1 --- /dev/null Thu Jul 14 09:51:02 2005 +++ x3/README.CVS Thu Jul 14 09:50:52 2005 @@ -0,0 +1,8 @@ +This CVS repository is NO LONGER CURRENT. Development has been moved to SVN (subversion) at forge.novell.com. + +Subversion is a lot like CVS but much better designed, solving many cvs headaches such as renaming files, tracking version numbers, and proper trunk support. + +http://forge.novell.com/modules/xfmod/svn/svnpage.php/evilnet/ + + +This repository will remain for historical purposes only. Index: x3/src/nickserv.c diff -u x3/src/nickserv.c:1.27 x3/src/nickserv.c:1.28 --- x3/src/nickserv.c:1.27 Wed May 18 09:03:13 2005 +++ x3/src/nickserv.c Thu Jul 14 09:50:52 2005 @@ -3625,6 +3625,7 @@ { FILE *file; char line[128]; + log_module(NS_LOG, LOG_ERROR, "Attempting to open dictionary file %s", fname); if (!(file = fopen(fname, "r"))) { log_module(NS_LOG, LOG_ERROR, "Unable to open dictionary file %s: %s", fname, strerror(errno)); return; ----------------------- End of diff ----------------------- |