diff --git a/Changes b/Changes index 2cf87ae7b..b0bda2461 100644 --- a/Changes +++ b/Changes @@ -727,3 +727,5 @@ system can now be used to properly block words with accents and things like that, just the way you block English words. Bug reported by MJ12Helios (#0002311). - Fixed 'russian-w1251', was not working ok at all. +- Made it so halfops can -h themselves, and chanadmins can -a themselves, reported + by fez (#0001503). diff --git a/src/modules/m_mode.c b/src/modules/m_mode.c index 95217c888..0f8bf34be 100644 --- a/src/modules/m_mode.c +++ b/src/modules/m_mode.c @@ -727,26 +727,34 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, if (is_half_op(cptr, chptr) && !is_chan_op(cptr, chptr) && !IsULine(cptr) && !op_can_override(cptr) && !samode_in_progress) { - /* Ugly halfop hack --sts - - this allows halfops to do +b +e +v and so on */ - /* (Syzop/20040413: Allow remote halfop modes */ - if ((Halfop_mode(modetype) == FALSE) && MyClient(cptr)) + if (MyClient(cptr) && (modetype == MODE_HALFOP) && (what == MODE_DEL) && + param && (find_client(param, NULL) == cptr)) { - int eaten = 0; - while (tab->mode != 0x0) + /* halfop -h'ing him/herself */ + /* ALLOW */ + } else + { + /* Ugly halfop hack --sts + - this allows halfops to do +b +e +v and so on */ + /* (Syzop/20040413: Allow remote halfop modes */ + if ((Halfop_mode(modetype) == FALSE) && MyClient(cptr)) { - if (tab->mode == modetype) + int eaten = 0; + while (tab->mode != 0x0) { - sendto_one(cptr, - err_str(ERR_NOTFORHALFOPS), me.name, - cptr->name, tab->flag); - eaten = tab->parameters; - break; + if (tab->mode == modetype) + { + sendto_one(cptr, + err_str(ERR_NOTFORHALFOPS), me.name, + cptr->name, tab->flag); + eaten = tab->parameters; + break; + } + tab++; } - tab++; + return eaten; } - return eaten; - } + } /* not -h self */ } switch (modetype) { @@ -915,7 +923,9 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, } case MODE_CHANPROT: REQUIRE_PARAMETER() - if (!IsULine(cptr) && !IsServer(cptr) && !is_chanowner(cptr, chptr) && !samode_in_progress) + /* not uline, not server, not chanowner, not an samode, not -a'ing yourself... */ + if (!IsULine(cptr) && !IsServer(cptr) && !is_chanowner(cptr, chptr) && !samode_in_progress && + !(param && (what == MODE_DEL) && (find_client(param, NULL) == cptr))) { if (MyClient(cptr) && !op_can_override(cptr)) {