From db2a7fe52533bd927c45ae25bc107283059553db Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Tue, 28 Mar 2000 05:33:39 +0000 Subject: [PATCH] Author: Kev Log message: * include/channel.h: add BOUNCE, renumber flags to get a little more space * ircd/channel.c (modebuf_flush): don't overload HACK2, add BOUNCE; send DESYNCH message git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@89 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 10 +++++++++- include/channel.h | 18 ++++++++++-------- ircd/channel.c | 25 ++++++++++++++++--------- 3 files changed, 35 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 448e988..0fc2658 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-03-28 Kevin L. Mitchell + + * include/channel.h: add BOUNCE, renumber flags to get a little + more space + + * ircd/channel.c (modebuf_flush): don't overload HACK2, add + BOUNCE; send DESYNCH message + 2000-03-27 Kevin L. Mitchell * ircd/m_clearmode.c (do_clearmode): only mark the modes the @@ -108,7 +116,7 @@ # # ChangeLog for ircu2.10.11 # -# $Id: ChangeLog,v 1.34 2000-03-28 02:40:30 kev Exp $ +# $Id: ChangeLog,v 1.35 2000-03-28 05:33:39 kev Exp $ # # Insert new changes at beginning of the change list. # diff --git a/include/channel.h b/include/channel.h index 5f7fa24..6f09862 100644 --- a/include/channel.h +++ b/include/channel.h @@ -251,14 +251,16 @@ struct ModeBuf { /* A mode w/args */ }; -#define MODEBUF_DEST_CHANNEL 0x01 /* Mode is flushed to channel */ -#define MODEBUF_DEST_SERVER 0x02 /* Mode is flushed to server */ - -#define MODEBUF_DEST_OPMODE 0x08 /* Send server mode as OPMODE */ -#define MODEBUF_DEST_DEOP 0x10 /* Deop the offender */ -#define MODEBUF_DEST_HACK2 0x20 /* Send a HACK(2) notice, reverse */ -#define MODEBUF_DEST_HACK3 0x40 /* Send a HACK(3) notice, TS == 0 */ -#define MODEBUF_DEST_HACK4 0x80 /* Send a HACK(4) notice, TS == 0 */ +#define MODEBUF_DEST_CHANNEL 0x0001 /* Mode is flushed to channel */ +#define MODEBUF_DEST_SERVER 0x0002 /* Mode is flushed to server */ + +#define MODEBUF_DEST_OPMODE 0x0100 /* Send server mode as OPMODE */ +#define MODEBUF_DEST_DEOP 0x0200 /* Deop the offender */ +#define MODEBUF_DEST_BOUNCE 0x0400 /* Bounce the modes */ + +#define MODEBUF_DEST_HACK2 0x2000 /* Send a HACK(2) notice, reverse */ +#define MODEBUF_DEST_HACK3 0x4000 /* Send a HACK(3) notice, TS == 0 */ +#define MODEBUF_DEST_HACK4 0x8000 /* Send a HACK(4) notice, TS == 0 */ #define MB_TYPE(mb, i) ((mb)->mb_modeargs[(i)].mbm_type) #define MB_UINT(mb, i) ((mb)->mb_modeargs[(i)].mbm_arg.mbma_uint) diff --git a/ircd/channel.c b/ircd/channel.c index cdad174..9fe8e42 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -2923,18 +2923,18 @@ modebuf_flush(struct ModeBuf *mbuf) } /* send the messages off to their destination */ - if (mbuf->mb_dest & MODEBUF_DEST_CHANNEL) - sendto_channel_butserv(mbuf->mb_channel, app_source, - ":%s MODE %s %s%s%s%s%s%s", app_source->name, - mbuf->mb_channel->chname, addbuf_i ? "+" : "", - addbuf, rembuf_i ? "-" : "", rembuf, addstr, - remstr); - - if (mbuf->mb_dest & MODEBUF_DEST_HACK2) + if (mbuf->mb_dest & MODEBUF_DEST_HACK2) { sendto_op_mask(SNO_HACK2, "HACK(2): %s MODE %s %s%s%s%s%s%s [" TIME_T_FMT "]", app_source->name, mbuf->mb_channel->chname, addbuf_i ? "+" : "", addbuf, rembuf_i ? "-" : "", rembuf, addstr, remstr, mbuf->mb_channel->creationtime); + sendto_serv_butone(mbuf->connect, "%s " TOK_DESYNCH + " :HACK: %s MODE %s %s%s%s%s%s%s [" TIME_T_FMT "]", + NumServ(&me), app_source->name, + mbuf->mb_channel->chname, addbuf_i ? "+" : "", addbuf, + rembuf_i ? "-" : "", rembuf, addstr, remstr, + mbuf->mb_channel->creationtime); + } if (mbuf->mb_dest & MODEBUF_DEST_HACK3) sendto_op_mask(SNO_HACK3, "BOUNCE or HACK(3): %s MODE %s %s%s%s%s%s%s [" @@ -2948,6 +2948,13 @@ modebuf_flush(struct ModeBuf *mbuf) "]", app_source->name, mbuf->mb_channel->chname, addbuf_i ? "+" : "", addbuf, rembuf_i ? "-" : "", rembuf, addstr, remstr, mbuf->mb_channel->creationtime); + + if (mbuf->mb_dest & MODEBUF_DEST_CHANNEL) + sendto_channel_butserv(mbuf->mb_channel, app_source, + ":%s MODE %s %s%s%s%s%s%s", app_source->name, + mbuf->mb_channel->chname, addbuf_i ? "+" : "", + addbuf, rembuf_i ? "-" : "", rembuf, addstr, + remstr); } /* Now are we supposed to propagate to other servers? */ @@ -3014,7 +3021,7 @@ modebuf_flush(struct ModeBuf *mbuf) mbuf->mb_channel->chname, addbuf_i ? "+" : "", addbuf, rembuf_i ? "-" : "", rembuf, addstr, remstr); - } else if (mbuf->mb_dest & MODEBUF_DEST_HACK2) { + } else if (mbuf->mb_dest & MODEBUF_DEST_BOUNCE) { /* * If HACK2 was set, we're bouncing; we send the MODE back to the * connection we got it from with the senses reversed and a TS of 0; -- 2.20.1