]> jfr.im git - solanum.git/commitdiff
Tweak previous commit to avoid problems with OMODE.
authorJilles Tjoelker <redacted>
Fri, 31 Dec 2010 01:43:16 +0000 (02:43 +0100)
committerJilles Tjoelker <redacted>
Fri, 31 Dec 2010 01:43:16 +0000 (02:43 +0100)
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.

src/chmode.c

index c828abbd5c7c3bc0272e7539f1da4003070be2d5..a268fdc5d8593b16e0bbec6f1ddfab916a7b095e 100644 (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;