Tweak previous commit to avoid problems with OMODE.

Do not allow a user to op themselves if they are
already opped, as "already opped" could be because
of OMODE's hack which will be unconditionally
reverted after the mode change.

Also, this matches old behaviour for users not
being able to generate mode changes redundantly
opping themselves.

Note that this change should only be taken advantage
of if all servers run patched code. Otherwise, mode
changes will be silently dropped and a desync
results.
This commit is contained in:
Jilles Tjoelker 2010-12-31 02:43:16 +01:00
parent 402cce0b9c
commit fa0e215255

View file

@ -885,6 +885,9 @@ chm_op(struct Client *source_p, struct Channel *chptr,
if(dir == MODE_ADD)
{
if(targ_p == source_p && mstptr->flags & CHFL_CHANOP)
return;
mode_changes[mode_count].letter = c;
mode_changes[mode_count].dir = MODE_ADD;
mode_changes[mode_count].caps = 0;