You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(47) |
Aug
(62) |
Sep
(17) |
Oct
(21) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(54) |
Feb
(89) |
Mar
(33) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Michael L. <par...@us...> - 2005-03-15 03:08:38
|
Update of /cvsroot/finop/mod_cmds/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9330/include Modified Files: cmd_public.h finop.h Log Message: added useraccess command Index: finop.h =================================================================== RCS file: /cvsroot/finop/mod_cmds/include/finop.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- finop.h 3 Mar 2005 20:48:40 -0000 1.5 +++ finop.h 15 Mar 2005 03:08:26 -0000 1.6 @@ -132,6 +132,14 @@ #define UNDERLINE "\x1F" +/* + * Common replies to commands. + */ +#define ERR_INVALID_CHAN "Invalid channel $b%s$b." +#define ERR_INVALID_SYNTAX "[$b%s$b] Invalid syntax; see $bhelp %s$b for more information." +#define ERR_NOT_AUTHED "[$b%s$b] %s is not currently authenticated." + + #ifdef __cplusplus extern "C" { @@ -398,7 +406,8 @@ int (*irc_nick_cmp)(char* a, char* b); char* (*irc_get_nick_from_host)(char* host); char* (*irc_get_host_from_host)(char* host); - char* (*irc_get_reply_target)(char* chan, char* nick); + void (*irc_get_reply_target)(char* ochan, char* nick, char* omsg, + char** chan, char** msg); /* * memory.c @@ -453,6 +462,7 @@ int (*memory_is_user_oper)(struct connection* cptr, char* user); int (*memory_is_user_protected)(struct connection* cptr, char* chan, char* attacker_nick, char* target_nick); + char* (*memory_userformat_to_handle)(struct connection* cptr, char* fmt); /* * conf.c Index: cmd_public.h =================================================================== RCS file: /cvsroot/finop/mod_cmds/include/cmd_public.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- cmd_public.h 27 Feb 2005 02:36:59 -0000 1.1 +++ cmd_public.h 15 Mar 2005 03:08:26 -0000 1.2 @@ -26,6 +26,9 @@ #define ERR_FORTUNE_NONE "No fortune file specified (\"finop/fortunefile\")." #define ERR_FORTUNE_OPEN "Unable to open file \"%s\"." #define MSG_FORTUNE "$b%s$b: %s" +#define MSG_USERACCESS_1 "[$buseraccess$b] $b*%s$b has %i access in %s." +#define MSG_USERACCESS_2 "[$buseraccess$b] $b*%s$b has %i access in %s, and is an $badministrator$b." +#define MSG_USERACCESS_3 "[$buseraccess$b] $b*%s$b has %i access in %s, and is an $badministrator$b of level %i." #ifdef __cplusplus extern "C" @@ -34,6 +37,7 @@ int version_cmd(struct connection* cptr, char* packet, char** tok_arr); int fortune_cmd(struct connection* cptr, char* packet, char** tok_arr); +int useraccess_cmd(struct connection* cptr, char* packet, char** tok_arr); #ifdef __cplusplus } |
|
From: Michael L. <par...@us...> - 2005-03-15 03:08:37
|
Update of /cvsroot/finop/mod_cmds/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9330/src Modified Files: Makefile cmd_public.c mod_cmds.c Log Message: added useraccess command Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_cmds/src/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 3 Mar 2005 20:48:40 -0000 1.5 +++ Makefile 15 Mar 2005 03:08:26 -0000 1.6 @@ -19,8 +19,8 @@ LDFLAGS = -shared # Target binaries (always created as BIN) -BIN = mod_cmds -DBIN = mod_cmds-debug +BIN = mod_cmds.so +DBIN = mod_cmds-debug.so INCLUDES = -I. -I../include Index: cmd_public.c =================================================================== RCS file: /cvsroot/finop/mod_cmds/src/cmd_public.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- cmd_public.c 1 Mar 2005 22:55:04 -0000 1.2 +++ cmd_public.c 15 Mar 2005 03:08:26 -0000 1.3 @@ -31,11 +31,8 @@ * Notice the FinOP kernel's version. */ int version_cmd(struct connection* cptr, char* packet, char** tok_arr) { - char* nick; - char* user; - char* str; + char* nick, *user, *str; int plvl; - char* package, *version, *code_name, *date, *time; nick = finop->irc_get_nick_from_host(tok_arr[0]); @@ -61,21 +58,16 @@ * Privmsg a random fortune from the fortune file. */ int fortune_cmd(struct connection* cptr, char* packet, char** tok_arr) { - char* nick; - char* user; - char* file; + char* nick, *user, *file, *chan; char* str = NULL; - char* chan; int plvl; FILE* fptr; - int i; - int buf_size = 0; + int i, buf_size = 0; char byte; - char* buf; - char* s; + char* buf, *s; nick = finop->irc_get_nick_from_host(tok_arr[0]); - chan = finop->irc_get_reply_target(tok_arr[2], nick); + finop->irc_get_reply_target(tok_arr[2], nick, NULL, &chan, NULL); if (!finop->conf_has_access_for_cmd(cptr, nick, "fortune", chan)) { free(nick); @@ -156,3 +148,104 @@ free(nick); return FINOP_CONT; } + + +/* + * Notice access of a given user in a given channel. + * Syntax: useraccess [channel] [*handle | nickname] + */ +int useraccess_cmd(struct connection* cptr, char* packet, char** tok_arr) { + char* nick, *user, *chan, *msg; + char* handle, *str; + char** msg_tok = NULL; + int plvl; + int access, admin, alvl, iadmin; + + nick = finop->irc_get_nick_from_host(tok_arr[0]); + finop->irc_get_reply_target(tok_arr[2], nick, tok_arr[3], &chan, &msg); + if (!finop->conf_has_access_for_cmd(cptr, nick, "useraccess", chan)) { + free(nick); + free(chan); + free(msg); + return FINOP_CONT; + } + + user = finop->memory_query_user_handle(cptr, nick); + plvl = finop->conf_user_plvl(user); + + if (!finop->conf_chan_exists(cptr->id, chan)) { + /* + * Invalid channel. + */ + str = finop->va(NULL, ERR_INVALID_CHAN, chan); + finop->irc_send_notice(cptr, nick, str, plvl, user); + free(str); + + free(nick); + free(chan); + free(msg); + return FINOP_CONT; + } + + if (*msg) { + /* + * We are provided with a user(nick | handle). + */ + msg_tok = finop->token_parse(msg, ' ', NULL); + handle = finop->memory_userformat_to_handle(cptr, msg_tok[0]); + } else + /* + * No user provided, assume target is issuer. + */ + handle = user; + + /* + * No valid handle available? + */ + if (!handle) { + str = finop->va(NULL, ERR_NOT_AUTHED, "useraccess", msg_tok[0]); + finop->irc_send_notice(cptr, nick, str, plvl, user); + free(str); + free(nick); + free(chan); + free(msg); + if (msg_tok) + finop->token_free(msg_tok); + return FINOP_CONT; + } + + access = finop->conf_user_access(cptr->id, handle, chan); + admin = finop->conf_user_is_admin(handle); + iadmin = finop->conf_user_is_admin(user); + if (iadmin) + alvl = finop->conf_user_admin_lvl(handle); + + /* + * For any normal user: + * 1) If the target is a normal user send MSG_USERACCESS_1 + * 2) If the target is an administrator send MSG_USERACCESS_2 + * For any administrator: + * 1) If the target is a normal user send MSG_USERACCESS_1 + * 2) If the target is an administrator send MSG_USERACCESS_3 + */ + if (!iadmin) { + if (!admin) + str = finop->va(NULL, MSG_USERACCESS_1, handle, access, chan); + else + str = finop->va(NULL, MSG_USERACCESS_2, handle, access, chan); + } else { + if (!admin) + str = finop->va(NULL, MSG_USERACCESS_1, handle, access, chan); + else + str = finop->va(NULL, MSG_USERACCESS_3, handle, access, chan, alvl); + } + finop->irc_send_notice(cptr, nick, str, plvl, user); + free(str); + + free(nick); + free(chan); + free(msg); + if (msg_tok) + finop->token_free(msg_tok); + return FINOP_CONT; +} Index: mod_cmds.c =================================================================== RCS file: /cvsroot/finop/mod_cmds/src/mod_cmds.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mod_cmds.c 27 Feb 2005 02:37:00 -0000 1.2 +++ mod_cmds.c 15 Mar 2005 03:08:26 -0000 1.3 @@ -102,6 +102,7 @@ finop->register_cmd(mptr, "rehash", rehash_cmd, FINOP_REG_PRI_CMD); finop->register_cmd(mptr, "version", version_cmd, FINOP_REG_PRI_CMD); finop->register_cmd(mptr, "fortune", fortune_cmd, FINOP_REG_PRI_CMD); + finop->register_cmd(mptr, "useraccess", useraccess_cmd, FINOP_REG_PRI_CMD); } |
|
From: Michael L. <par...@us...> - 2005-03-15 03:08:35
|
Update of /cvsroot/finop/mod_cmds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9330 Modified Files: mod_cmds.pws Log Message: added useraccess command Index: mod_cmds.pws =================================================================== RCS file: /cvsroot/finop/mod_cmds/mod_cmds.pws,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- mod_cmds.pws 1 Mar 2005 22:55:03 -0000 1.5 +++ mod_cmds.pws 15 Mar 2005 03:08:25 -0000 1.6 @@ -11,11 +11,12 @@ filter.dir.ignore.hidden=0 [filenumbers] -0=78 -1=402 -2=92 -3=40 -4=39 +0=29 +1=36 +2=140 +3=92 +4=40 +5=105 [filemarkers] 0= @@ -23,13 +24,15 @@ 2= 3= 4= +5= [filelist] -0=/home/para/Projects/mod_cmds/src/cmd_public.c -1=/home/para/Projects/finop.h -2=/home/para/Projects/mod_cmds/src/afterburns.c -3=/home/para/Projects/mod_cmds/src/help_listings.c -4=/home/para/Projects/mod_cmds/src/mod_cmds.c +0=/home/para/Projects/mod_cmds/include/cmd_public.h +1=/home/para/Projects/mod_cmds/src/cmd_public.c +2=/home/para/Projects/finop.h +3=/home/para/Projects/mod_cmds/src/afterburns.c +4=/home/para/Projects/mod_cmds/src/help_listings.c +5=/home/para/Projects/mod_cmds/src/mod_cmds.c [Project Tree] 0=0 |
|
From: Michael L. <par...@us...> - 2005-03-15 03:07:41
|
Update of /cvsroot/finop/mod_stub/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9070/include Modified Files: finop.h Log Message: finop.h update Index: finop.h =================================================================== RCS file: /cvsroot/finop/mod_stub/include/finop.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- finop.h 3 Mar 2005 20:49:25 -0000 1.11 +++ finop.h 15 Mar 2005 03:07:22 -0000 1.12 @@ -132,6 +132,14 @@ #define UNDERLINE "\x1F" +/* + * Common replies to commands. + */ +#define ERR_INVALID_CHAN "Invalid channel $b%s$b." +#define ERR_INVALID_SYNTAX "[$b%s$b] Invalid syntax; see $bhelp %s$b for more information." +#define ERR_NOT_AUTHED "[$b%s$b] %s is not currently authenticated." + + #ifdef __cplusplus extern "C" { @@ -398,7 +406,8 @@ int (*irc_nick_cmp)(char* a, char* b); char* (*irc_get_nick_from_host)(char* host); char* (*irc_get_host_from_host)(char* host); - char* (*irc_get_reply_target)(char* chan, char* nick); + void (*irc_get_reply_target)(char* ochan, char* nick, char* omsg, + char** chan, char** msg); /* * memory.c @@ -453,6 +462,7 @@ int (*memory_is_user_oper)(struct connection* cptr, char* user); int (*memory_is_user_protected)(struct connection* cptr, char* chan, char* attacker_nick, char* target_nick); + char* (*memory_userformat_to_handle)(struct connection* cptr, char* fmt); /* * conf.c |
|
From: Michael L. <par...@us...> - 2005-03-15 03:07:41
|
Update of /cvsroot/finop/mod_stub/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9070/src Modified Files: Makefile Log Message: finop.h update Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_stub/src/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile 3 Mar 2005 20:49:25 -0000 1.7 +++ Makefile 15 Mar 2005 03:07:23 -0000 1.8 @@ -19,8 +19,8 @@ LDFLAGS = -shared # Target binaries (always created as BIN) -BIN = mod_stub -DBIN = mod_stub-debug +BIN = mod_stub.so +DBIN = mod_stub-debug.so INCLUDES = -I. -I../include |
|
From: Michael L. <par...@us...> - 2005-03-15 03:07:09
|
Update of /cvsroot/finop/mod_mods/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8919/include Modified Files: finop.h Log Message: finop.h update Index: finop.h =================================================================== RCS file: /cvsroot/finop/mod_mods/include/finop.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- finop.h 3 Mar 2005 20:47:19 -0000 1.13 +++ finop.h 15 Mar 2005 03:06:56 -0000 1.14 @@ -132,6 +132,14 @@ #define UNDERLINE "\x1F" +/* + * Common replies to commands. + */ +#define ERR_INVALID_CHAN "Invalid channel $b%s$b." +#define ERR_INVALID_SYNTAX "[$b%s$b] Invalid syntax; see $bhelp %s$b for more information." +#define ERR_NOT_AUTHED "[$b%s$b] %s is not currently authenticated." + + #ifdef __cplusplus extern "C" { @@ -398,7 +406,8 @@ int (*irc_nick_cmp)(char* a, char* b); char* (*irc_get_nick_from_host)(char* host); char* (*irc_get_host_from_host)(char* host); - char* (*irc_get_reply_target)(char* chan, char* nick); + void (*irc_get_reply_target)(char* ochan, char* nick, char* omsg, + char** chan, char** msg); /* * memory.c @@ -453,6 +462,7 @@ int (*memory_is_user_oper)(struct connection* cptr, char* user); int (*memory_is_user_protected)(struct connection* cptr, char* chan, char* attacker_nick, char* target_nick); + char* (*memory_userformat_to_handle)(struct connection* cptr, char* fmt); /* * conf.c |
|
From: Michael L. <par...@us...> - 2005-03-15 03:07:09
|
Update of /cvsroot/finop/mod_mods/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8919/src Modified Files: Makefile Log Message: finop.h update Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_mods/src/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 3 Mar 2005 20:47:20 -0000 1.6 +++ Makefile 15 Mar 2005 03:06:56 -0000 1.7 @@ -19,8 +19,8 @@ LDFLAGS = -shared # Target binaries (always created as BIN) -BIN = mod_mods -DBIN = mod_mods-debug +BIN = mod_mods.so +DBIN = mod_mods-debug.so INCLUDES = -I. -I../include |
|
From: Michael L. <par...@us...> - 2005-03-15 03:06:37
|
Update of /cvsroot/finop/mod_base/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8803/src Modified Files: Makefile Log Message: finop.h update Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_base/src/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile 3 Mar 2005 20:46:09 -0000 1.9 +++ Makefile 15 Mar 2005 03:06:26 -0000 1.10 @@ -19,8 +19,8 @@ LDFLAGS = -shared # Target binaries (always created as BIN) -BIN = mod_base -DBIN = mod_base-debug +BIN = mod_base.so +DBIN = mod_base-debug.so INCLUDES = -I. -I../include |
|
From: Michael L. <par...@us...> - 2005-03-15 03:06:37
|
Update of /cvsroot/finop/mod_base/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8803/include Modified Files: finop.h Log Message: finop.h update Index: finop.h =================================================================== RCS file: /cvsroot/finop/mod_base/include/finop.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- finop.h 3 Mar 2005 20:46:09 -0000 1.18 +++ finop.h 15 Mar 2005 03:06:26 -0000 1.19 @@ -132,6 +132,14 @@ #define UNDERLINE "\x1F" +/* + * Common replies to commands. + */ +#define ERR_INVALID_CHAN "Invalid channel $b%s$b." +#define ERR_INVALID_SYNTAX "[$b%s$b] Invalid syntax; see $bhelp %s$b for more information." +#define ERR_NOT_AUTHED "[$b%s$b] %s is not currently authenticated." + + #ifdef __cplusplus extern "C" { @@ -398,7 +406,8 @@ int (*irc_nick_cmp)(char* a, char* b); char* (*irc_get_nick_from_host)(char* host); char* (*irc_get_host_from_host)(char* host); - char* (*irc_get_reply_target)(char* chan, char* nick); + void (*irc_get_reply_target)(char* ochan, char* nick, char* omsg, + char** chan, char** msg); /* * memory.c @@ -453,6 +462,7 @@ int (*memory_is_user_oper)(struct connection* cptr, char* user); int (*memory_is_user_protected)(struct connection* cptr, char* chan, char* attacker_nick, char* target_nick); + char* (*memory_userformat_to_handle)(struct connection* cptr, char* fmt); /* * conf.c |
|
From: Michael L. <par...@us...> - 2005-03-15 03:06:37
|
Update of /cvsroot/finop/mod_base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8803 Modified Files: Makefile Log Message: finop.h update Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_base/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 3 Mar 2005 20:46:09 -0000 1.5 +++ Makefile 15 Mar 2005 03:06:25 -0000 1.6 @@ -7,8 +7,8 @@ # # $Header$ -BIN = finop -DBIN = finop-debug +BIN = mod_base +DBIN = mod_base-debug all: $(BIN) debug: $(DBIN) |
|
From: Michael L. <par...@us...> - 2005-03-15 03:05:15
|
Update of /cvsroot/finop/finop2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329 Modified Files: TODO finop2.prj finop2.pws Log Message: irc.c:irc_get_reply_target() now picks target better and parses message Index: TODO =================================================================== RCS file: /cvsroot/finop/finop2/TODO,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- TODO 3 Mar 2005 20:40:38 -0000 1.15 +++ TODO 15 Mar 2005 03:04:31 -0000 1.16 @@ -29,7 +29,7 @@ / version uptime / auth - useraccess + / useraccess info / help @@ -111,6 +111,11 @@ WORK LOG: +14 Mar 2005 + * updated irc.c:irc_get_reply_target() to guess target, between real channel, nickname, and PRIVMSG string + function also parses PRIVMSG string to drop any prefix command (and channel, if any) + * [mod_cmds] added useraccess command + 3 Mar 2005 * using a new makefile for finop and all mods * fixed a bug in conf.c:add_new_user() which could cause seg faults Index: finop2.pws =================================================================== RCS file: /cvsroot/finop/finop2/finop2.pws,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- finop2.pws 3 Mar 2005 20:40:39 -0000 1.6 +++ finop2.pws 15 Mar 2005 03:04:32 -0000 1.7 @@ -11,13 +11,13 @@ filter.dir.ignore.hidden=0 [filenumbers] -0=172 -1=597 -2=67 +0=179 +1=172 +2=618 3=67 4=86 -5=226 -6=115 +5=281 +6=154 7=32 8=1160 @@ -33,9 +33,9 @@ 8= [filelist] -0=/home/para/Projects/finop2/include/irc.h -1=/home/para/Projects/finop2/src/irc.c -2=/home/para/Projects/finop2/src/core.c +0=/home/para/Projects/finop2/src/conf.c +1=/home/para/Projects/finop2/include/irc.h +2=/home/para/Projects/finop2/src/irc.c 3=/home/para/Projects/finop2/include/definitions.h 4=/home/para/Projects/finop2/src/main.c 5=/home/para/Projects/finop2/include/mod.h Index: finop2.prj =================================================================== RCS file: /cvsroot/finop/finop2/finop2.prj,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- finop2.prj 12 Feb 2005 23:45:52 -0000 1.1 +++ finop2.prj 15 Mar 2005 03:04:32 -0000 1.2 @@ -59,6 +59,7 @@ preferences.build.option.jobs=0 preferences.build.option.silent=0 preferences.build.option.autosave=0 +preferences.anjuta.make.options=debug preferences.make=make preferences.build.option.keep.going=1 preferences.build.option.warn.undef=0 |
|
From: Michael L. <par...@us...> - 2005-03-15 03:05:15
|
Update of /cvsroot/finop/finop2/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/include Modified Files: irc.h memory.h mod.h Log Message: irc.c:irc_get_reply_target() now picks target better and parses message Index: irc.h =================================================================== RCS file: /cvsroot/finop/finop2/include/irc.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- irc.h 3 Mar 2005 20:40:39 -0000 1.12 +++ irc.h 15 Mar 2005 03:04:33 -0000 1.13 @@ -169,7 +169,8 @@ char* irc_get_nick_from_host(char* host); char* irc_get_host_from_host(char* host); -char* irc_get_reply_target(char* chan, char* nick); +void irc_get_reply_target(char* ochan, char* nick, char* omsg, char** chan, + char** msg); #ifdef __cplusplus } Index: mod.h =================================================================== RCS file: /cvsroot/finop/finop2/include/mod.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- mod.h 3 Mar 2005 20:40:39 -0000 1.21 +++ mod.h 15 Mar 2005 03:04:34 -0000 1.22 @@ -222,7 +222,8 @@ int (*irc_nick_cmp)(char* a, char* b); char* (*irc_get_nick_from_host)(char* host); char* (*irc_get_host_from_host)(char* host); - char* (*irc_get_reply_target)(char* chan, char* nick); + void (*irc_get_reply_target)(char* ochan, char* nick, char* omsg, + char** chan, char** msg); /* * memory.c @@ -277,6 +278,7 @@ int (*memory_is_user_oper)(struct connection* cptr, char* user); int (*memory_is_user_protected)(struct connection* cptr, char* chan, char* attacker_nick, char* target_nick); + char* (*memory_userformat_to_handle)(struct connection* cptr, char* fmt); /* * conf.c Index: memory.h =================================================================== RCS file: /cvsroot/finop/finop2/include/memory.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- memory.h 21 Jan 2005 05:35:47 -0000 1.7 +++ memory.h 15 Mar 2005 03:04:34 -0000 1.8 @@ -98,6 +98,8 @@ int memory_is_user_protected(struct connection* cptr, char* chan, char* attacker_nick, char* target_nick); +char* memory_userformat_to_handle(struct connection* cptr, char* fmt); + #ifdef __cplusplus } #endif |
|
From: Michael L. <par...@us...> - 2005-03-15 03:04:57
|
Update of /cvsroot/finop/finop2/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8329/src Modified Files: conf.c irc.c memory.c mod.c Log Message: irc.c:irc_get_reply_target() now picks target better and parses message Index: mod.c =================================================================== RCS file: /cvsroot/finop/finop2/src/mod.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- mod.c 3 Mar 2005 20:40:39 -0000 1.25 +++ mod.c 15 Mar 2005 03:04:35 -0000 1.26 @@ -151,6 +151,7 @@ memory_set_user_oper, memory_is_user_oper, memory_is_user_protected, + memory_userformat_to_handle, /* * conf.c Index: memory.c =================================================================== RCS file: /cvsroot/finop/finop2/src/memory.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- memory.c 17 Feb 2005 20:34:48 -0000 1.16 +++ memory.c 15 Mar 2005 03:04:35 -0000 1.17 @@ -829,3 +829,17 @@ */ return 0; } + + +/* + * Given either: + * fmt = *HANDLE + * or + * fmt = NICK + * return the assoicated handle (if any). + */ +char* memory_userformat_to_handle(struct connection* cptr, char* fmt) { + if (*fmt == '*') + return (fmt + 1); + return memory_query_user_handle(cptr, fmt); +} Index: conf.c =================================================================== RCS file: /cvsroot/finop/finop2/src/conf.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- conf.c 3 Mar 2005 20:40:39 -0000 1.19 +++ conf.c 15 Mar 2005 03:04:34 -0000 1.20 @@ -176,7 +176,7 @@ * Return 1 if the given channel exists. */ int conf_chan_exists(char* server_id, char* chan) { - char* path = va(NULL, "servers/%s/%s", server_id, chan); + char* path = va(NULL, "servers/%s/channels/%s", server_id, chan); struct pdb_node_t* nptr = pdb_query_node(g_dbptr, path); free(path); return (nptr ? 1 : 0); Index: irc.c =================================================================== RCS file: /cvsroot/finop/finop2/src/irc.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- irc.c 3 Mar 2005 20:40:39 -0000 1.14 +++ irc.c 15 Mar 2005 03:04:35 -0000 1.15 @@ -592,13 +592,78 @@ * Estimate what the return target should be. * That is, if the passed chan is a real channel, the reply is the channel; * if it is something else (ie PRIVMSG to finop), reply is the nick. + * + * If the msg starts with a channel name, return that channel name; if so + * change the msg pointer to be after that channel token. + * + * chan and msg will be allocated strings. */ -char* irc_get_reply_target(char* chan, char* nick) { +void irc_get_reply_target(char* ochan, char* nick, char* omsg, char** chan, + char** msg) { + /* * TODO * make this if condition dependent on server settings */ - if ((*chan == '#') || (*chan == '&')) - return chan; - return nick; + + /* + * Check the message first. + */ + char* tmsg = NULL; + char* tchan = NULL; + char* s = NULL; + if (omsg) { + /* + * Skip all whitespaces. + */ + s = omsg; + while (*s) { + if (*s != ' ') + break; + ++s; + } + + /* + * The first token must be skipped (should be a command). + */ + while (*s) { + if (*s++ == ' ') + break; + } + tmsg = s; + + if ((*s == '#') || (*s == '&')) { + char* ctok = s; + while (*s) { + if (*s == ' ') + break; + ++s; + } + + ++s; + + if (chan) { + *chan = (char*)malloc(s - ctok); + memcpy(*chan, ctok, (s - ctok - 1)); + } + if (msg) + *msg = strdup(s); + + return; + } + } + + /* + * If the message did not start with a channel, check if + * the given channel is valid. + */ + if ((*ochan == '#') || (*ochan == '&')) + tchan = ochan; + else + tchan = nick; + + if (chan) + *chan = strdup(tchan); + if (msg) + *msg = strdup(s); } |
|
From: Michael L. <par...@us...> - 2005-03-03 20:49:40
|
Update of /cvsroot/finop/mod_stub/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9902/src Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_stub/src/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 13 Feb 2005 00:10:34 -0000 1.6 +++ Makefile 3 Mar 2005 20:49:25 -0000 1.7 @@ -1,28 +1,48 @@ # Minimal Makefile # # By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> +# +# $Header$ CC = gcc -CFLAGS = -Wall -g -LDFLAGS = -shared -DEPFLAGS = -fPIC +# Universal cflags +CFLAGS = -Wall -pipe -# Needed to recognize .c as a file suffix -.SUFFIXES: $(SUFFIXES) . +# Object flags +FLAGS = $(CFLAGS) -fPIC -O2 +# Debug object flags +DFLAGS = $(CFLAGS) -fPIC -g + +# Linking flags +LDFLAGS = -shared + +# Target binaries (always created as BIN) BIN = mod_stub +DBIN = mod_stub-debug + INCLUDES = -I. -I../include -OBJS = afterburns.o \ - mod_stub.o + +SRC_FILES = $(wildcard *.c) + +OBJS = $(SRC_FILES:%.c=%.o) +DOBJS = $(OBJS:%.o=d_%.o) all: $(BIN) +debug: $(DBIN) clean: - rm *.o + @rm *.o $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) + $(CC) $(FLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) -.c.o: - $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $*.c +$(DBIN): $(DOBJS) + $(CC) $(DEBUG_FLAGS) $(LDFLAGS) $(DOBJS) -o $(BIN) + +%.o: %.c + $(CC) $(FLAGS) $(INCLUDES) -c $< + +d_%.o: %.c + $(CC) $(DFLAGS) $(INCLUDES) -c $< -o $@ |
|
From: Michael L. <par...@us...> - 2005-03-03 20:49:39
|
Update of /cvsroot/finop/mod_stub/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9902/include Modified Files: finop.h Log Message: Using new makefiles. |
|
From: Michael L. <par...@us...> - 2005-03-03 20:49:39
|
Update of /cvsroot/finop/mod_stub In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9902 Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_stub/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 13 Feb 2005 00:10:19 -0000 1.4 +++ Makefile 3 Mar 2005 20:49:25 -0000 1.5 @@ -4,14 +4,20 @@ # # This Makefile will invoke the Makefile in # the src/ subdirectory. +# +# $Header$ BIN = mod_stub +DBIN = mod_stub-debug all: $(BIN) +debug: $(DBIN) $(BIN): - cd src && make + cd src/ && $(MAKE) -clean: - cd src && make clean +$(DBIN): + cd src/ && $(MAKE) debug +clean: + cd src/ && $(MAKE) clean |
|
From: Michael L. <par...@us...> - 2005-03-03 20:48:49
|
Update of /cvsroot/finop/mod_cmds/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9650/src Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_cmds/src/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 27 Feb 2005 02:37:00 -0000 1.4 +++ Makefile 3 Mar 2005 20:48:40 -0000 1.5 @@ -1,35 +1,48 @@ # Minimal Makefile # # By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> +# +# $Header$ CC = gcc -CFLAGS = -Wall -g -LDFLAGS = -shared -DEPFLAGS = -fPIC +# Universal cflags +CFLAGS = -Wall -pipe -# Needed to recognize .c as a file suffix -.SUFFIXES: $(SUFFIXES) . +# Object flags +FLAGS = $(CFLAGS) -fPIC -O2 +# Debug object flags +DFLAGS = $(CFLAGS) -fPIC -g + +# Linking flags +LDFLAGS = -shared + +# Target binaries (always created as BIN) BIN = mod_cmds +DBIN = mod_cmds-debug + INCLUDES = -I. -I../include -OBJS = afterburns.o \ - help_listings.o \ - cmd_public.o \ - cmd_authed.o \ - cmd_low.o \ - cmd_mid.o \ - cmd_high.o \ - cmd_admin.o \ - mod_cmds.o + +SRC_FILES = $(wildcard *.c) + +OBJS = $(SRC_FILES:%.c=%.o) +DOBJS = $(OBJS:%.o=d_%.o) all: $(BIN) +debug: $(DBIN) clean: - rm *.o + @rm *.o $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) + $(CC) $(FLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) -.c.o: - $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $*.c +$(DBIN): $(DOBJS) + $(CC) $(DEBUG_FLAGS) $(LDFLAGS) $(DOBJS) -o $(BIN) + +%.o: %.c + $(CC) $(FLAGS) $(INCLUDES) -c $< + +d_%.o: %.c + $(CC) $(DFLAGS) $(INCLUDES) -c $< -o $@ |
|
From: Michael L. <par...@us...> - 2005-03-03 20:48:49
|
Update of /cvsroot/finop/mod_cmds/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9650/include Modified Files: finop.h Log Message: Using new makefiles. |
|
From: Michael L. <par...@us...> - 2005-03-03 20:48:49
|
Update of /cvsroot/finop/mod_cmds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9650 Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_cmds/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 13 Feb 2005 00:22:14 -0000 1.3 +++ Makefile 3 Mar 2005 20:48:40 -0000 1.4 @@ -4,14 +4,20 @@ # # This Makefile will invoke the Makefile in # the src/ subdirectory. +# +# $Header$ BIN = mod_cmds +DBIN = mod_cmds-debug all: $(BIN) +debug: $(DBIN) $(BIN): - cd src && make + cd src/ && $(MAKE) -clean: - cd src && make clean +$(DBIN): + cd src/ && $(MAKE) debug +clean: + cd src/ && $(MAKE) clean |
|
From: Michael L. <par...@us...> - 2005-03-03 20:48:15
|
Update of /cvsroot/finop/mod_mods In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9249 Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_mods/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Makefile 13 Feb 2005 00:03:27 -0000 1.6 +++ Makefile 3 Mar 2005 20:47:19 -0000 1.7 @@ -4,14 +4,20 @@ # # This Makefile will invoke the Makefile in # the src/ subdirectory. +# +# $Header$ BIN = mod_mods +DBIN = mod_mods-debug all: $(BIN) +debug: $(DBIN) $(BIN): - cd src && make + cd src/ && $(MAKE) -clean: - cd src && make clean +$(DBIN): + cd src/ && $(MAKE) debug +clean: + cd src/ && $(MAKE) clean |
|
From: Michael L. <par...@us...> - 2005-03-03 20:47:48
|
Update of /cvsroot/finop/mod_mods/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9249/src Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_mods/src/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 13 Feb 2005 00:03:27 -0000 1.5 +++ Makefile 3 Mar 2005 20:47:20 -0000 1.6 @@ -1,29 +1,48 @@ # Minimal Makefile # # By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> +# +# $Header$ CC = gcc -CFLAGS = -Wall -g -LDFLAGS = -shared -DEPFLAGS = -fPIC +# Universal cflags +CFLAGS = -Wall -pipe -# Needed to recognize .c as a file suffix -.SUFFIXES: $(SUFFIXES) . +# Object flags +FLAGS = $(CFLAGS) -fPIC -O2 +# Debug object flags +DFLAGS = $(CFLAGS) -fPIC -g + +# Linking flags +LDFLAGS = -shared + +# Target binaries (always created as BIN) BIN = mod_mods +DBIN = mod_mods-debug + INCLUDES = -I. -I../include -OBJS = afterburns.o \ - help_listings.o \ - mod_mods.o + +SRC_FILES = $(wildcard *.c) + +OBJS = $(SRC_FILES:%.c=%.o) +DOBJS = $(OBJS:%.o=d_%.o) all: $(BIN) +debug: $(DBIN) clean: - rm *.o + @rm *.o $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) + $(CC) $(FLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) -.c.o: - $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $*.c +$(DBIN): $(DOBJS) + $(CC) $(DEBUG_FLAGS) $(LDFLAGS) $(DOBJS) -o $(BIN) + +%.o: %.c + $(CC) $(FLAGS) $(INCLUDES) -c $< + +d_%.o: %.c + $(CC) $(DFLAGS) $(INCLUDES) -c $< -o $@ |
|
From: Michael L. <par...@us...> - 2005-03-03 20:47:33
|
Update of /cvsroot/finop/mod_mods/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9249/include Modified Files: finop.h Log Message: Using new makefiles. |
|
From: Michael L. <par...@us...> - 2005-03-03 20:46:36
|
Update of /cvsroot/finop/mod_base/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8728/include Modified Files: finop.h Log Message: Using new makefiles. Index: finop.h =================================================================== RCS file: /cvsroot/finop/mod_base/include/finop.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- finop.h 27 Feb 2005 02:38:09 -0000 1.17 +++ finop.h 3 Mar 2005 20:46:09 -0000 1.18 @@ -398,7 +398,8 @@ int (*irc_nick_cmp)(char* a, char* b); char* (*irc_get_nick_from_host)(char* host); char* (*irc_get_host_from_host)(char* host); - + char* (*irc_get_reply_target)(char* chan, char* nick); + /* * memory.c */ |
|
From: Michael L. <par...@us...> - 2005-03-03 20:46:35
|
Update of /cvsroot/finop/mod_base/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8728/src Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_base/src/Makefile,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Makefile 12 Feb 2005 23:56:06 -0000 1.8 +++ Makefile 3 Mar 2005 20:46:09 -0000 1.9 @@ -1,30 +1,48 @@ # Minimal Makefile # # By: Michael Laforest <paralizer -AT- users -DOT- sourceforge -DOT- net> +# +# $Header$ CC = gcc -CFLAGS = -Wall -g -LDFLAGS = -shared -DEPFLAGS = -fPIC +# Universal cflags +CFLAGS = -Wall -pipe -# Needed to recognize .c as a file suffix -.SUFFIXES: $(SUFFIXES) . +# Object flags +FLAGS = $(CFLAGS) -fPIC -O2 +# Debug object flags +DFLAGS = $(CFLAGS) -fPIC -g + +# Linking flags +LDFLAGS = -shared + +# Target binaries (always created as BIN) BIN = mod_base +DBIN = mod_base-debug + INCLUDES = -I. -I../include -OBJS = afterburns.o \ - help.o \ - help_listings.o \ - mod_base.o + +SRC_FILES = $(wildcard *.c) + +OBJS = $(SRC_FILES:%.c=%.o) +DOBJS = $(OBJS:%.o=d_%.o) all: $(BIN) +debug: $(DBIN) clean: - rm *.o + @rm *.o $(BIN): $(OBJS) - $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) + $(CC) $(FLAGS) $(LDFLAGS) $(OBJS) -o $(BIN) -.c.o: - $(CC) $(CFLAGS) $(DEPFLAGS) $(INCLUDES) -c $*.c +$(DBIN): $(DOBJS) + $(CC) $(DEBUG_FLAGS) $(LDFLAGS) $(DOBJS) -o $(BIN) + +%.o: %.c + $(CC) $(FLAGS) $(INCLUDES) -c $< + +d_%.o: %.c + $(CC) $(DFLAGS) $(INCLUDES) -c $< -o $@ |
|
From: Michael L. <par...@us...> - 2005-03-03 20:46:21
|
Update of /cvsroot/finop/mod_base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8728 Modified Files: Makefile Log Message: Using new makefiles. Index: Makefile =================================================================== RCS file: /cvsroot/finop/mod_base/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 12 Feb 2005 23:56:06 -0000 1.4 +++ Makefile 3 Mar 2005 20:46:09 -0000 1.5 @@ -4,14 +4,20 @@ # # This Makefile will invoke the Makefile in # the src/ subdirectory. +# +# $Header$ -BIN = mod_base +BIN = finop +DBIN = finop-debug all: $(BIN) +debug: $(DBIN) $(BIN): - cd src && make + cd src/ && $(MAKE) -clean: - cd src && make clean +$(DBIN): + cd src/ && $(MAKE) debug +clean: + cd src/ && $(MAKE) clean |