X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fproto-common.c;h=6ddd23f4a7b1bb6e5f29d9bd65ad1888658b78c7;hb=0669b78c4bb443fbc6642eddcbe6778cfd124d6f;hp=b7b9bc22d09665618ba8f479a5aa4b38e1d4c3cf;hpb=fcb1c7816df34f42bdfa36501e761d5af0ee3508;p=srvx.git diff --git a/src/proto-common.c b/src/proto-common.c index b7b9bc2..6ddd23f 100644 --- a/src/proto-common.c +++ b/src/proto-common.c @@ -628,12 +628,18 @@ mod_chanmode_free(struct mod_chanmode *change) int mod_chanmode(struct userNode *who, struct chanNode *channel, char **modes, unsigned int argc, unsigned int flags) { + struct modeNode *member; struct mod_chanmode *change; unsigned int ii; + short base_oplevel; if (!modes || !modes[0]) return 0; - if (!(change = mod_chanmode_parse(channel, modes, argc, flags))) + if (who && (member = GetUserMode(channel, who))) + base_oplevel = member->oplevel; + else + base_oplevel = MAXOPLEVEL; + if (!(change = mod_chanmode_parse(channel, modes, argc, flags, base_oplevel))) return 0; if (flags & MC_ANNOUNCE) mod_chanmode_announce(who, channel, change);