diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Makefile | 2 | ||||
| -rw-r--r-- | src/core/Makefile | 5 | ||||
| -rw-r--r-- | src/core/Makefile.sub | 5 | ||||
| -rw-r--r-- | src/core/hs_group.c | 3 | ||||
| -rw-r--r-- | src/core/hs_setall.c | 2 | ||||
| -rw-r--r-- | src/core/ms_read.c | 2 | ||||
| -rw-r--r-- | src/core/ms_rsend.c | 1 | ||||
| -rw-r--r-- | src/core/ms_send.c | 1 | ||||
| -rw-r--r-- | src/core/ms_sendall.c | 1 | ||||
| -rw-r--r-- | src/core/ms_staff.c | 1 | ||||
| -rw-r--r-- | src/modules/Makefile | 5 | ||||
| -rw-r--r-- | src/modules/Makefile.sub | 5 | ||||
| -rw-r--r-- | src/protocol/Makefile | 5 | ||||
| -rw-r--r-- | src/protocol/Makefile.sub | 5 | ||||
| -rw-r--r-- | src/protocol/inspircd.c | 19 | ||||
| -rw-r--r-- | src/protocol/plexus.c | 2270 | ||||
| -rw-r--r-- | src/protocol/ptlink.c | 5 |
17 files changed, 1274 insertions, 1063 deletions
diff --git a/src/Makefile b/src/Makefile index f187f263c..4627127c0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -22,7 +22,7 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' 'MYSQL=${MYSQL}'\ - 'RDB=${RDB}' 'SHARED=${SHARED}' + 'RDB=${RDB}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' .c.o: $(CC) $(CFLAGS) -I../include/ -c $< diff --git a/src/core/Makefile b/src/core/Makefile index e73fd7e7c..602d43bec 100644 --- a/src/core/Makefile +++ b/src/core/Makefile @@ -5,12 +5,11 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' \ - 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' + 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' OBJECTS= $(SRCS:.c=.o) SO_FILES=$(OBJECTS:.o=.s) CDEFS= -g -rdynamic -Wall -CFLAGS=$(CFLAGS) $(CDEFS) all: modules subs @@ -22,7 +21,7 @@ install: distclean: clean spotless .c.o: - $(CC) $(CFLAGS) -I../${INCLUDEDIR} -c $< + $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< .o.s: $(CC) ${SHARED} $< -o $*.so ${PROFILE} diff --git a/src/core/Makefile.sub b/src/core/Makefile.sub index b060ca5b6..7c4744ce8 100644 --- a/src/core/Makefile.sub +++ b/src/core/Makefile.sub @@ -3,12 +3,11 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' \ - 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' + 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' OBJECTS= $(SRCS:.c=.o) SO_FILES=$(OBJECTS:.o=.s) CDEFS= -g -rdynamic -Wall -CFLAGS=$(CFLAGS) $(CDEFS) all: module @@ -17,7 +16,7 @@ module: $(OBJECTS) so distclean: clean spotless .c.o: - $(CC) $(CFLAGS) -I../ -I../../${INCLUDEDIR} -c $< + $(CC) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $< so: $(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE} diff --git a/src/core/hs_group.c b/src/core/hs_group.c index db034a948..9f5ef0a3e 100644 --- a/src/core/hs_group.c +++ b/src/core/hs_group.c @@ -17,6 +17,9 @@ int do_group(User * u); void myHostServHelp(User * u); +extern int do_hs_sync(NickCore * nc, char *vIdent, char *hostmask, + char *creator, time_t time); + /** * Create the off command, and tell anope about it. diff --git a/src/core/hs_setall.c b/src/core/hs_setall.c index a0685a89f..3d0a5a83c 100644 --- a/src/core/hs_setall.c +++ b/src/core/hs_setall.c @@ -17,6 +17,8 @@ int do_setall(User * u); void myHostServHelp(User * u); +extern int do_hs_sync(NickCore * nc, char *vIdent, char *hostmask, + char *creator, time_t time); /** * Create the off command, and tell anope about it. diff --git a/src/core/ms_read.c b/src/core/ms_read.c index 4c650f5e1..d608d0a37 100644 --- a/src/core/ms_read.c +++ b/src/core/ms_read.c @@ -19,6 +19,8 @@ int do_read(User * u); int read_memo_callback(User * u, int num, va_list args); int read_memo(User * u, int index, MemoInfo * mi, const char *chan); void myMemoServHelp(User * u); +extern void rsend_notify(User * u, Memo * m, const char *chan); + /** * Create the command, and tell anope about it. diff --git a/src/core/ms_rsend.c b/src/core/ms_rsend.c index b712f4af1..0b0c7b995 100644 --- a/src/core/ms_rsend.c +++ b/src/core/ms_rsend.c @@ -17,6 +17,7 @@ int do_rsend(User * u); void myMemoServHelp(User * u); +extern void memo_send(User * u, char *name, char *text, int z); /** * Create the command, and tell anope about it. diff --git a/src/core/ms_send.c b/src/core/ms_send.c index c366072a4..bbca927f9 100644 --- a/src/core/ms_send.c +++ b/src/core/ms_send.c @@ -17,6 +17,7 @@ int do_send(User * u); void myMemoServHelp(User * u); +extern void memo_send(User * u, char *name, char *text, int z); /** * Create the command, and tell anope about it. diff --git a/src/core/ms_sendall.c b/src/core/ms_sendall.c index 36eae983f..589d9871b 100644 --- a/src/core/ms_sendall.c +++ b/src/core/ms_sendall.c @@ -17,6 +17,7 @@ int do_sendall(User * u); void myMemoServHelp(User * u); +extern void memo_send(User * u, char *name, char *text, int z); /** * Create the command, and tell anope about it. diff --git a/src/core/ms_staff.c b/src/core/ms_staff.c index 091a23ce5..534aeeb24 100644 --- a/src/core/ms_staff.c +++ b/src/core/ms_staff.c @@ -17,6 +17,7 @@ int do_staff(User * u); void myMemoServHelp(User * u); +extern void memo_send(User * u, char *name, char *text, int z); /** * Create the command, and tell anope about it. diff --git a/src/modules/Makefile b/src/modules/Makefile index e73fd7e7c..602d43bec 100644 --- a/src/modules/Makefile +++ b/src/modules/Makefile @@ -5,12 +5,11 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' \ - 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' + 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' OBJECTS= $(SRCS:.c=.o) SO_FILES=$(OBJECTS:.o=.s) CDEFS= -g -rdynamic -Wall -CFLAGS=$(CFLAGS) $(CDEFS) all: modules subs @@ -22,7 +21,7 @@ install: distclean: clean spotless .c.o: - $(CC) $(CFLAGS) -I../${INCLUDEDIR} -c $< + $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< .o.s: $(CC) ${SHARED} $< -o $*.so ${PROFILE} diff --git a/src/modules/Makefile.sub b/src/modules/Makefile.sub index b060ca5b6..7c4744ce8 100644 --- a/src/modules/Makefile.sub +++ b/src/modules/Makefile.sub @@ -3,12 +3,11 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' \ - 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' + 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' OBJECTS= $(SRCS:.c=.o) SO_FILES=$(OBJECTS:.o=.s) CDEFS= -g -rdynamic -Wall -CFLAGS=$(CFLAGS) $(CDEFS) all: module @@ -17,7 +16,7 @@ module: $(OBJECTS) so distclean: clean spotless .c.o: - $(CC) $(CFLAGS) -I../ -I../../${INCLUDEDIR} -c $< + $(CC) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $< so: $(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE} diff --git a/src/protocol/Makefile b/src/protocol/Makefile index e73fd7e7c..602d43bec 100644 --- a/src/protocol/Makefile +++ b/src/protocol/Makefile @@ -5,12 +5,11 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' \ - 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' + 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' OBJECTS= $(SRCS:.c=.o) SO_FILES=$(OBJECTS:.o=.s) CDEFS= -g -rdynamic -Wall -CFLAGS=$(CFLAGS) $(CDEFS) all: modules subs @@ -22,7 +21,7 @@ install: distclean: clean spotless .c.o: - $(CC) $(CFLAGS) -I../${INCLUDEDIR} -c $< + $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../${INCLUDEDIR} -c $< .o.s: $(CC) ${SHARED} $< -o $*.so ${PROFILE} diff --git a/src/protocol/Makefile.sub b/src/protocol/Makefile.sub index b060ca5b6..7c4744ce8 100644 --- a/src/protocol/Makefile.sub +++ b/src/protocol/Makefile.sub @@ -3,12 +3,11 @@ MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'ANOPELIBS=${ANOPELIBS}' \ 'INCLUDEDIR=${INCLUDEDIR}' 'RM=${RM}' 'CP=${CP}' \ 'TOUCH=${TOUCH}' 'SHELL=${SHELL}' 'DATDEST=${DATDEST}' \ 'RUNGROUP=${RUNGROUP}' 'MODULE_PATH=${MODULE_PATH}' \ - 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' + 'PROFILE=${PROFILE}' 'SHARED=${SHARED}' 'MODULEFLAGS=${MODULEFLAGS}' OBJECTS= $(SRCS:.c=.o) SO_FILES=$(OBJECTS:.o=.s) CDEFS= -g -rdynamic -Wall -CFLAGS=$(CFLAGS) $(CDEFS) all: module @@ -17,7 +16,7 @@ module: $(OBJECTS) so distclean: clean spotless .c.o: - $(CC) $(CFLAGS) -I../ -I../../${INCLUDEDIR} -c $< + $(CC) $(CC) ${CFLAGS} ${CDEFS} ${MODULEFLAGS} -I../ -I../../${INCLUDEDIR} -c $< so: $(CC) ${SHARED} $(OBJECTS) -o ../$(TARGET).so ${PROFILE} diff --git a/src/protocol/inspircd.c b/src/protocol/inspircd.c index e16f38e9d..762c2260c 100644 --- a/src/protocol/inspircd.c +++ b/src/protocol/inspircd.c @@ -522,7 +522,7 @@ void inspircd_cmd_vhost_off(User * u) void inspircd_cmd_akill(char *user, char *host, char *who, time_t when, time_t expires, char *reason) { - send_cmd(CreateSum(), "# %s@%s %s %lu %lu :%s", user, host, who, (long int)when, 86400 * 2, reason); + send_cmd(CreateSum(), "# %s@%s %s %lu %lu :%s", user, host, who, (unsigned long)when, (unsigned long)86400 * 2, reason); } void inspircd_cmd_svskill(char *source, char *user, char *buf) @@ -586,9 +586,9 @@ void inspircd_cmd_bot_nick(char *nick, char *user, char *host, char *real, void inspircd_cmd_kick(char *source, char *chan, char *user, char *buf) { if (buf) { - send_cmd(CreateSum(), "k %s %s :%s", source, user, chan, buf); + send_cmd(CreateSum(), "k %s %s %s :%s", source, user, chan, buf); } else { - send_cmd(CreateSum(), "k %s %s :", source, user, chan); + send_cmd(CreateSum(), "k %s %s %s :", source, user, chan); } } @@ -682,7 +682,6 @@ int anope_event_eob(char *source, int ac, char **av) /* SERVER name hop descript */ void inspircd_cmd_server(char *servname, int hop, char *descript) { - Server *newserv; if (hop == 0) { send_cmd(CreateSum(), "H %s",servname); @@ -758,7 +757,7 @@ void inspircd_cmd_part(char *nick, char *chan, char *buf) return; } if (buf) { - send_cmd(CreateSum(), "L %s :%s", nick, chan, buf); + send_cmd(CreateSum(), "L %s %s :%s", nick, chan, buf); } else { send_cmd(CreateSum(), "L %s %s :", nick, chan); } @@ -1037,17 +1036,9 @@ int anope_event_kick(char *source, int ac, char **av) int anope_event_join(char *source, int ac, char **av) { - //if (ac != 2) - // return MOD_CONT; - //char *v[32]; - //v[0] = av[1]; - //do_join(av[0], 1, v); - //return MOD_CONT; - User *u; Channel *c; int i; - int32 modes = 0, thismode; char* new_av[32]; char* cumodes[3]; char thismodes[256]; @@ -1295,7 +1286,7 @@ void inspircd_cmd_unszline(char *mask) void inspircd_cmd_szline(char *mask, char *reason, char *whom) { // } <mask> <who-set-it> <time-set> <duration> :<reason> - send_cmd(CreateSum(), "} %s %s %lu %lu :%s",mask,whom,(long int) time(NULL),86400 * 2, reason); + send_cmd(CreateSum(), "} %s %s %lu %lu :%s",mask,whom,(unsigned long)time(NULL),(unsigned long)86400 * 2, reason); } /* SGLINE */ diff --git a/src/protocol/plexus.c b/src/protocol/plexus.c index 32f9feea3..c85b38eb3 100644 --- a/src/protocol/plexus.c +++ b/src/protocol/plexus.c @@ -1,6 +1,4 @@ /* PlexusIRCD IRCD functions -/* PlexusIRCD IRCD functions -/* PlexusIRCD IRCD functions * * (C) 2003-2005 Anope Team * Contact us at info@anope.org @@ -8,194 +6,199 @@ * Please read COPYING and README for furhter details. * * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - * - * - */ + * Based on the original code of Services by Andy Church. + **/ #include "services.h" #include "pseudo.h" #include "plexus.h" IRCDVar myIrcd[] = { - {"PleXusIRCd 2.0+", /* ircd name */ - "+oiSR", /* nickserv mode */ - "+oiSR", /* chanserv mode */ - "+oiSR", /* memoserv mode */ - "+oiSR", /* hostserv mode */ - "+oaiSR", /* operserv mode */ - "+oiSR", /* botserv mode */ - "+oiSR", /* helpserv mode */ - "+oiSR", /* Dev/Null mode */ - "+oiSR", /* Global mode */ - "+oiSR", /* nickserv alias mode */ - "+oiSR", /* chanserv alias mode */ - "+oiSR", /* memoserv alias mode */ - "+oiSR", /* hostserv alias mode */ - "+oaiSR", /* operserv alias mode */ - "+oiSR", /* botserv alias mode */ - "+oiSR", /* helpserv alias mode */ - "+oiSR", /* Dev/Null alias mode */ - "+oiSR", /* Global alias mode */ - "+iSR", /* Used by BotServ Bots */ - 3, /* Chan Max Symbols */ - "-acilmnpstMNORZ", /* Modes to Remove */ - "+o", /* Channel Umode used by Botserv bots */ - 1, /* SVSNICK */ - 1, /* Vhost */ - 0, /* Has Owner */ - NULL, /* Mode to set for an owner */ - NULL, /* Mode to unset for an owner */ - NULL, /* Mode to set for chan admin */ - NULL, /* Mode to unset for chan admin */ - "+R", /* Mode On Reg */ - "-R", /* Mode on UnReg */ - "-R", /* Mode on Nick Change */ - 0, /* Supports SGlines */ - 1, /* Supports SQlines */ - 0, /* Supports SZlines */ - 1, /* Supports Halfop +h */ - 3, /* Number of server args */ - 0, /* Join 2 Set */ - 0, /* Join 2 Message */ - 1, /* Has exceptions +e */ - 0, /* TS Topic Forward */ - 0, /* TS Topci Backward */ - 0, /* Protected Umode */ - 0, /* Has Admin */ - 1, /* Chan SQlines */ - 0, /* Quit on Kill */ - 0, /* SVSMODE unban */ - 0, /* Has Protect */ - 0, /* Reverse */ - 0, /* Chan Reg */ - 0, /* Channel Mode */ - 0, /* vidents */ - 0, /* svshold */ - 1, /* time stamp on mode */ - 0, /* NICKIP */ - 0, /* UMODE */ - 0, /* O:LINE */ - 1, /* VHOST ON NICK */ - 0, /* Change RealName */ - CMODE_p, /* No Knock */ - 0, /* Admin Only */ - DEFAULT_MLOCK, /* Default MLOCK */ - UMODE_h, /* Vhost Mode */ - 0, /* +f */ - 0, /* +L */ - 0, /* +f Mode */ - 0, /* +L Mode */ - 0, /* On nick change check if they could be identified */ - 0, /* No Knock requires +i */ - NULL, /* CAPAB Chan Modes */ - 0, /* We support TOKENS */ - 1, /* TOKENS are CASE inSensitive */ - 0, /* TIME STAMPS are BASE64 */ - 1, /* +I support */ - 0, /* SJOIN ban char */ - 0, /* SJOIN except char */ - 0, /* SJOIN invite char */ - 0, /* Can remove User Channel Modes with SVSMODE */ - 0, /* Sglines are not enforced until user reconnects */ - "h", /* vhost char */ - 0, /* ts6 */ - 0, /* support helper umode */ - 0, /* p10 */ - NULL, /* character set */ - 1, /* reports sync state */ - } - , - {NULL} + {"PleXusIRCd 2.0+", /* ircd name */ + "+oiSR", /* nickserv mode */ + "+oiSR", /* chanserv mode */ + "+oiSR", /* memoserv mode */ + "+oiSR", /* hostserv mode */ + "+oaiSR", /* operserv mode */ + "+oiSR", /* botserv mode */ + "+oiSR", /* helpserv mode */ + "+oiSR", /* Dev/Null mode */ + "+oiSR", /* Global mode */ + "+oiSR", /* nickserv alias mode */ + "+oiSR", /* chanserv alias mode */ + "+oiSR", /* memoserv alias mode */ + "+oiSR", /* hostserv alias mode */ + "+oaiSR", /* operserv alias mode */ + "+oiSR", /* botserv alias mode */ + "+oiSR", /* helpserv alias mode */ + "+oiSR", /* Dev/Null alias mode */ + "+oiSR", /* Global alias mode */ + "+iSR", /* Used by BotServ Bots */ + 3, /* Chan Max Symbols */ + "-acilmnpstMNORZ", /* Modes to Remove */ + "+o", /* Channel Umode used by Botserv bots */ + 1, /* SVSNICK */ + 1, /* Vhost */ + 0, /* Has Owner */ + NULL, /* Mode to set for an owner */ + NULL, /* Mode to unset for an owner */ + NULL, /* Mode to set for chan admin */ + NULL, /* Mode to unset for chan admin */ + "+R", /* Mode On Reg */ + "-R", /* Mode on UnReg */ + "-R", /* Mode on Nick Change */ + 0, /* Supports SGlines */ + 1, /* Supports SQlines */ + 0, /* Supports SZlines */ + 1, /* Supports Halfop +h */ + 3, /* Number of server args */ + 0, /* Join 2 Set */ + 0, /* Join 2 Message */ + 1, /* Has exceptions +e */ + 0, /* TS Topic Forward */ + 0, /* TS Topci Backward */ + 0, /* Protected Umode */ + 0, /* Has Admin */ + 1, /* Chan SQlines */ + 0, /* Quit on Kill */ + 0, /* SVSMODE unban */ + 0, /* Has Protect */ + 0, /* Reverse */ + 0, /* Chan Reg */ + 0, /* Channel Mode */ + 0, /* vidents */ + 0, /* svshold */ + 1, /* time stamp on mode */ + 0, /* NICKIP */ + 0, /* UMODE */ + 0, /* O:LINE */ + 1, /* VHOST ON NICK */ + 0, /* Change RealName */ + CMODE_p, /* No Knock */ + 0, /* Admin Only */ + DEFAULT_MLOCK, /* Default MLOCK */ + UMODE_h, /* Vhost Mode */ + 0, /* +f */ + 0, /* +L */ + 0, /* +f Mode */ + 0, /* +L Mode */ + 0, /* On nick change check if they could be identified */ + 0, /* No Knock requires +i */ + NULL, /* CAPAB Chan Modes */ + 0, /* We support TOKENS */ + 1, /* TOKENS are CASE inSensitive */ + 0, /* TIME STAMPS are BASE64 */ + 1, /* +I support */ + 0, /* SJOIN ban char */ + 0, /* SJOIN except char */ + 0, /* SJOIN invite char */ + 0, /* Can remove User Channel Modes with SVSMODE */ + 0, /* Sglines are not enforced until user reconnects */ + "h", /* vhost char */ + 0, /* ts6 */ + 0, /* support helper umode */ + 0, /* p10 */ + NULL, /* character set */ + 1, /* reports sync state */ + } + , + {NULL} }; IRCDCAPAB myIrcdcap[] = { - { - 0, /* NOQUIT */ - 0, /* TSMODE */ - 0, /* UNCONNECT */ - 0, /* NICKIP */ - 0, /* SJOIN */ - CAPAB_ZIP, /* ZIP */ - 0, /* BURST */ - CAPAB_TS5, /* TS5 */ - 0, /* TS3 */ - 0, /* DKEY */ - 0, /* PT4 */ - 0, /* SCS */ - CAPAB_QS, /* QS */ - CAPAB_UID, /* UID */ - CAPAB_KNOCK, /* KNOCK */ - 0, /* CLIENT */ - 0, /* IPV6 */ - 0, /* SSJ5 */ - 0, /* SN2 */ - 0, /* TOKEN */ - 0, /* VHOST */ - 0, /* SSJ3 */ - 0, /* NICK2 */ - 0, /* UMODE2 */ - 0, /* VL */ - 0, /* TLKEXT */ - 0, /* DODKEY */ - 0, /* DOZIP */ - 0, 0, 0} + { + 0, /* NOQUIT */ + 0, /* TSMODE */ + 0, /* UNCONNECT */ + 0, /* NICKIP */ + 0, /* SJOIN */ + CAPAB_ZIP, /* ZIP */ + 0, /* BURST */ + CAPAB_TS5, /* TS5 */ + 0, /* TS3 */ + 0, /* DKEY */ + 0, /* PT4 */ + 0, /* SCS */ + CAPAB_QS, /* QS */ + CAPAB_UID, /* UID */ + CAPAB_KNOCK, /* KNOCK */ + 0, /* CLIENT */ + 0, /* IPV6 */ + 0, /* SSJ5 */ + 0, /* SN2 */ + 0, /* TOKEN */ + 0, /* VHOST */ + 0, /* SSJ3 */ + 0, /* NICK2 */ + 0, /* UMODE2 */ + 0, /* VL */ + 0, /* TLKEXT */ + 0, /* DODKEY */ + 0, /* DOZIP */ + 0, 0, 0} }; -void plexus_set_umode(User * user, int ac, char **av) -{ - int add = 1; /* 1 if adding modes, 0 if deleting */ - char *modes = av[0]; - - ac--; - - if (debug) - alog("debug: Changing mode for %s to %s", user->nick, modes); - - while (*modes) { - - /* This looks better, much better than "add ? (do_add) : (do_remove)". - * At least this is readable without paying much attention :) -GD - */ - if (add) - user->mode |= umodes[(int) *modes]; - else - user->mode &= ~umodes[(int) *modes]; - - switch (*modes++) { - case '+': - add = 1; - break; - case '-': - add = 0; - break; - case 'h': - update_host(user); - break; - case 'o': - if (add) { - opcnt++; - - if (WallOper) - anope_cmd_global(s_OperServ, - "\2%s\2 is now an IRC operator.", - user->nick); - display_news(user, NEWS_OPER); - - } else { - opcnt--; - } - break; - case 'R': - if (add && !nick_identified(user)) { - common_svsmode(user, "-R", NULL); - user->mode &= ~UMODE_R; - } - break; - - } +void +plexus_set_umode (User * user, int ac, char **av) +{ + int add = 1; /* 1 if adding modes, 0 if deleting */ + char *modes = av[0]; + + ac--; + + if (debug) + alog ("debug: Changing mode for %s to %s", user->nick, modes); + + while (*modes) + { + + /* This looks better, much better than "add ? (do_add) : (do_remove)". + * At least this is readable without paying much attention :) -GD + */ + if (add) + user->mode |= umodes[(int) *modes]; + else + user->mode &= ~umodes[(int) *modes]; + + switch (*modes++) + { + case '+': + add = 1; + break; + case '-': + add = 0; + break; + case 'h': + update_host (user); + break; + case 'o': + if (add) + { + opcnt++; + + if (WallOper) + anope_cmd_global (s_OperServ, + "\2%s\2 is now an IRC operator.", + user->nick); + display_news (user, NEWS_OPER); + + } + else + { + opcnt--; + } + break; + case 'R': + if (add && !nick_identified (user)) + { + common_svsmode (user, "-R", NULL); + user->mode &= ~UMODE_R; + } + break; + + } } } @@ -207,565 +210,647 @@ void plexus_set_umode(User * user, int ac, char **av) * is_valid_op, as it always sends a -o. Breaking up the routines corrects this problem. - ThaPrince */ -int plexus_check_valid_halfop(User * user, Channel * chan, int servermode) +int +plexus_check_valid_halfop (User * user, Channel * chan, int servermode) { - if (!chan || !chan->ci) - return 1; + if (!chan || !chan->ci) + return 1; - /* They will be kicked; no need to deop, no need to update our internal struct too */ - if (chan->ci->flags & CI_VERBOTEN) - return 0; + /* They will be kicked; no need to deop, no need to update our internal struct too */ + if (chan->ci->flags & CI_VERBOTEN) + return 0; - if (servermode && !check_access(user, chan->ci, CA_AUTOHALFOP)) { - notice_lang(s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); - anope_cmd_mode(whosends(chan->ci), chan->name, "-h %s", - user->nick); - return 0; + if (servermode && !check_access (user, chan->ci, CA_AUTOHALFOP)) + { + notice_lang (s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); + anope_cmd_mode (whosends (chan->ci), chan->name, "-h %s", user->nick); + return 0; } - if (check_access(user, chan->ci, CA_AUTODEOP)) { - anope_cmd_mode(whosends(chan->ci), chan->name, "-h %s", - user->nick); - return 0; + if (check_access (user, chan->ci, CA_AUTODEOP)) + { + anope_cmd_mode (whosends (chan->ci), chan->name, "-h %s", user->nick); + return 0; } - return 1; + return 1; } -int plexus_check_valid_op(User * user, Channel * chan, int servermode) +int +plexus_check_valid_op (User * user, Channel * chan, int servermode) { - if (!chan || !chan->ci) - return 1; + if (!chan || !chan->ci) + return 1; - /* They will be kicked; no need to deop, no need to update our internal struct too */ - if (chan->ci->flags & CI_VERBOTEN) - return 0; + /* They will be kicked; no need to deop, no need to update our internal struct too */ + if (chan->ci->flags & CI_VERBOTEN) + return 0; - if (servermode && !check_access(user, chan->ci, CA_AUTOOP)) { - notice_lang(s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); - if (check_access(user, chan->ci, CA_AUTOHALFOP)) { - anope_cmd_mode(whosends(chan->ci), chan->name, - "-o+h %s %s", user->nick, user->nick); - } else { - anope_cmd_mode(whosends(chan->ci), chan->name, "-o %s", - user->nick); - } - return 0; + if (servermode && !check_access (user, chan->ci, CA_AUTOOP)) + { + notice_lang (s_ChanServ, user, CHAN_IS_REGISTERED, s_ChanServ); + if (check_access (user, chan->ci, CA_AUTOHALFOP)) + { + anope_cmd_mode (whosends (chan->ci), chan->name, + "-o+h %s %s", user->nick, user->nick); + } + else + { + anope_cmd_mode (whosends (chan->ci), chan->name, "-o %s", + user->nick); + } + return 0; } - if (check_access(user, chan->ci, CA_AUTODEOP)) { - anope_cmd_mode(whosends(chan->ci), chan->name, "-o %s", - user->nick); - return 0; + if (check_access (user, chan->ci, CA_AUTODEOP)) + { + anope_cmd_mode (whosends (chan->ci), chan->name, "-o %s", user->nick); + return 0; } - return 1; + return 1; } unsigned long umodes[128] = { - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused, Unused, Horzontal Tab */ - 0, 0, 0, /* Line Feed, Unused, Unused */ - 0, 0, 0, /* Carriage Return, Unused, Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused */ - 0, 0, 0, /* Unused, Unused, Space */ - 0, 0, 0, /* ! " # */ - 0, 0, 0, /* $ % & */ - 0, 0, 0, /* ! ( ) */ - 0, 0, 0, /* * + , */ - 0, 0, 0, /* - . / */ - 0, 0, /* 0 1 */ - 0, 0, /* 2 3 */ - 0, 0, /* 4 5 */ - 0, 0, /* 6 7 */ - 0, 0, /* 8 9 */ - 0, 0, /* : ; */ - 0, 0, 0, /* < = > */ - 0, 0, /* ? @ */ - 0, 0, 0, /* A B C */ - 0, 0, 0, /* D E F */ - 0, 0, 0, /* G H I */ - 0, 0, 0, /* J K L */ - 0, 0, 0, /* M N O */ - 0, 0, UMODE_R, /* P Q R */ - UMODE_S, 0, 0, /* S T U */ - 0, 0, 0, /* V W X */ - 0, /* Y */ - 0, /* Z */ - 0, 0, 0, /* [ \ ] */ - 0, 0, 0, /* ^ _ ` */ - UMODE_a, UMODE_b, 0, /* a b c */ - UMODE_d, 0, 0, /* d e f */ - 0, UMODE_h, UMODE_i, /* g h i */ - 0, 0, UMODE_l, /* j k l */ - UMODE_g, UMODE_n, UMODE_o, /* m n o */ - 0, 0, 0, /* p q r */ - 0, 0, UMODE_u, /* s t u */ - 0, UMODE_w, UMODE_x, /* v w x */ - 0, /* y */ - 0, /* z */ - 0, 0, 0, /* { | } */ - 0, 0 /* ~ ‚ */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused, Unused, Horzontal Tab */ + 0, 0, 0, /* Line Feed, Unused, Unused */ + 0, 0, 0, /* Carriage Return, Unused, Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused, Unused, Space */ + 0, 0, 0, /* ! " # */ + 0, 0, 0, /* $ % & */ + 0, 0, 0, /* ! ( ) */ + 0, 0, 0, /* * + , */ + 0, 0, 0, /* - . / */ |
