From ba0dd976537899d8711e2cc561cbcdacd984409b Mon Sep 17 00:00:00 2001 From: stskeeps Date: Fri, 31 Oct 2003 16:50:10 +0000 Subject: [PATCH] foo --- Changes | 8 +++++++- include/h.h | 1 + include/modules.h | 2 ++ src/modules/m_quit.c | 2 +- src/send.c | 24 +++++++++++++++++++++++- 5 files changed, 34 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index cad429181..ca6051f84 100644 --- a/Changes +++ b/Changes @@ -2514,7 +2514,6 @@ seen. gmtime warning still there Suggested by brentos. Note that we won't support /quit, or any other command, just this. - Module coders: Moved call to HOOKTYPE_LOCAL_JOIN down to where the JOIN, NAMES, etc are already sent... this seems to make more sense since we have a prejoin hook now. -- Moved it a bit too far (outside the loop), should be fixed now. - Fixed bug where color quits were stripped when they shouldn't be >:). - Added 'action' field to ban version { } which can be: kill: kills the user (default), tempshun: shun the specific connection only, kline/zline/gline/gzline/shun: place @@ -2522,3 +2521,10 @@ seen. gmtime warning still there It's up to the admin to take a good decision, sometimes zlines are best (=won't use much sockets but will reconnect quite quickly), sometimes tempshun (=will use 1 socket but generates nearly no network traffic), sometimes klines/glines, etc.. +- Added sendto_umode_raw, sends to umodes, but not as a NOTICE +- Added hook HOOKTYPE_CHANNEL_CREATE (cptr(user creating channel), chptr + (channel that has gotten created) +- Added hook HOOKTYPE_CHANNEL_DESTROY (chptr (channel getting destroyed)) +- Fixed bug where unregistered quits would in extreme cases crash the server +- Moved it a bit too far (outside the loop), should be fixed now. + diff --git a/include/h.h b/include/h.h index 5c078350c..577bb335f 100644 --- a/include/h.h +++ b/include/h.h @@ -308,6 +308,7 @@ extern void sendto_failops_whoare_opers(char *, ...); extern void sendto_failops(char *, ...); extern void sendto_opers(char *, ...); extern void sendto_umode(int, char *, ...); +extern void sendto_umode_raw(int, char *, ...); extern void sendto_snomask(int snomask, char *pattern, ...); extern int writecalls, writeb[]; extern int deliver_it(aClient *, char *, int); diff --git a/include/modules.h b/include/modules.h index 1a85cc2ec..d99d8e232 100644 --- a/include/modules.h +++ b/include/modules.h @@ -464,6 +464,8 @@ int CallCmdoverride(Cmdoverride *ovr, aClient *cptr, aClient *sptr, int parc, ch #define HOOKTYPE_PRE_LOCAL_KICK 29 #define HOOKTYPE_PRE_LOCAL_TOPIC 30 #define HOOKTYPE_REMOTE_NICKCHANGE 31 +#define HOOKTYPE_CHANNEL_CREATE 32 +#define HOOKTYPE_CHANNEL_DESTROY 33 /* Module flags */ #define MODFLAG_NONE 0x0000 diff --git a/src/modules/m_quit.c b/src/modules/m_quit.c index 3ba6941e0..b8a11ea1d 100644 --- a/src/modules/m_quit.c +++ b/src/modules/m_quit.c @@ -120,7 +120,7 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[]) ocomment = parv[0]; /* Strip color codes if any channel is +S, use nick as reason if +c. */ - if (strchr(ocomment, '\003')) + if (IsPerson(sptr) && (strchr(ocomment, '\003'))) { unsigned char filtertype = 0; /* 1=filter, 2=block, highest wins. */ for (lp = sptr->user->channel; lp; lp = lp->next) diff --git a/src/send.c b/src/send.c index 77ff8016b..523763dea 100644 --- a/src/send.c +++ b/src/send.c @@ -1397,8 +1397,30 @@ void sendto_umode(int umodes, char *pattern, ...) va_end(vl); return; } + /* - * sendto_umode + * sendto_umode_raw + * + * Send to specified umode , raw, not a notice + */ +void sendto_umode_raw(int umodes, char *pattern, ...) +{ + va_list vl; + aClient *cptr; + int i; + va_start(vl, pattern); + for (i = 0; i <= LastSlot; i++) + if ((cptr = local[i]) && IsPerson(cptr) && (cptr->umodes & umodes) == umodes) + { + va_start(vl, pattern); + vsendto_one(cptr, pattern, vl); + va_end(vl); + } + va_end(vl); + return; +} +/* + * sendto_snomask * * Send to specified umode */