X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/dfaa28a4e56e833f042a2e59c206efb6d31acd72..8dc0685213ead3f8896c83cadc130143ccc4d181:/src/chanserv.c diff --git a/src/chanserv.c b/src/chanserv.c index 4623769..3b0986c 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -236,7 +236,7 @@ static const struct message_entry msgtab[] = { { "CSMSG_BAN_DONE", "Banned $b%s$b from %s." }, { "CSMSG_REASON_CHANGE", "Reason for LAMER $b%s$b changed." }, { "CSMSG_LAMER_EXTENDED", "Extended LAMER for $b%s$b, now expires in %s." }, - { "CSMSG_BAN_REMOVED", "Matching ban(s) and LAMER(s) in $b%s$b were removed." }, + { "CSMSG_BAN_REMOVED", "Ban(s) and LAMER(s) matching $b%s$b were removed." }, { "CSMSG_TRIMMED_LAMERS", "Trimmed $b%d LAMERs$b from the %s LAMER list that were inactive for at least %s." }, { "CSMSG_REDUNDANT_BAN", "$b%s$b is already banned in %s." }, { "CSMSG_REDUNDANT_LAMER", "$b%s$b is already LAMER'd in %s." }, @@ -2877,12 +2877,13 @@ static CHANSERV_FUNC(cmd_deluser) if(argc > 2) { access = user_level_from_name(argv[1], UL_OWNER); + char *useraccess = user_level_name_from_level(victim->access); if(!access) { reply("CSMSG_INVALID_ACCESS", argv[1]); return 0; } - if(access != victim->access) + if(strcasecmp(argv[1], useraccess)) { reply("CSMSG_INCORRECT_ACCESS", handle->handle, user_level_name_from_level(victim->access), argv[1]); return 0; @@ -7260,6 +7261,31 @@ handle_new_channel(struct chanNode *channel) SetChannelTopic(channel, chanserv, chanserv, channel->channel_info->topic, 1); } +int +trace_check_bans(struct userNode *user, struct chanNode *chan) +{ + struct banData *bData; + struct mod_chanmode *change; + + change = find_matching_bans(&chan->banlist, user, NULL); + if (change) + return 1; + + /* lamer list */ + if (chan->channel_info) { + for(bData = chan->channel_info->bans; bData; bData = bData->next) { + + if(!user_matches_glob(user, bData->mask, MATCH_USENICK)) + continue; + + if(bData) + return 1; + } + } + + return 0; +} + int check_bans(struct userNode *user, const char *channel) {