X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/e3b2f7897e4c0d610be203b88983f9bdc394deb1..17e4d28ec48db02784eebbf107b79d4331848090:/src/chanserv.c diff --git a/src/chanserv.c b/src/chanserv.c index c775849..a848135 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -2388,8 +2388,20 @@ merge_bans(struct chanData *source, struct chanData *target) static void merge_data(struct chanData *source, struct chanData *target) { + /* Use more recent visited and owner-transfer time; use older + * registered time. Bitwise or may_opchan. Use higher max. + * Do not touch last_refresh, ban count or user counts. + */ if(source->visited > target->visited) target->visited = source->visited; + if(source->registered < target->registered) + target->registered = source->registered; + if(source->ownerTransfer > target->ownerTransfer) + target->ownerTransfer = source->ownerTransfer; + if(source->may_opchan) + target->may_opchan = 1; + if(source->max > target->max) + target->max = source->max; } static void @@ -3002,7 +3014,7 @@ static CHANSERV_FUNC(cmd_devoice) } static int -bad_channel_ban(struct chanNode *channel, struct userNode *user, const char *ban, int *victimCount, struct modeNode **victims) +bad_channel_ban(struct chanNode *channel, struct userNode *user, const char *ban, unsigned int *victimCount, struct modeNode **victims) { unsigned int ii; @@ -3104,18 +3116,18 @@ eject_user(struct userNode *user, struct chanNode *channel, unsigned int argc, c reply("CSMSG_MASK_PROTECTED", argv[1]); return 0; } - /* We dont actually want a victem count if were banning a mask manually, IMO -Rubin*/ - if(cmd) - victimCount = 0; /* Dont deop etc ppl who match this */ - -#ifdef entropy_lameness - if((victimCount > 4) && ((victimCount * 3) > channel->members.used) && !IsOper(user)) +/* If i want to ban *.nl and theres 5 of them, what is it to the bot?!? +// if((victimCount > 4) && ((victimCount * 3) > channel->members.used) && !IsOper(user)) + And, ^^^^^^^^^ BAH! + We use x2 style over-mask detection instead because it doesnt stop channel owners from doing + reasonable bans, but does stop *@*, *@*a* *@*b* etc type masks. Yes, you can defeat it with + some creativity, but its not x3's job to be the ban censor anyway. */ + if(is_overmask(argv[1])) { if(cmd) reply("CSMSG_LAME_MASK", argv[1]); return 0; } -#endif if((action == ACTION_KICK) && (victimCount == 0)) { @@ -4419,9 +4431,10 @@ static CHANSERV_FUNC(cmd_info) reply("CSMSG_CHANNEL_USERS", cData->userCount); reply("CSMSG_CHANNEL_LAMERS", cData->banCount); reply("CSMSG_CHANNEL_VISITED", intervalString(buffer, now - cData->visited, user->handle_info)); - reply("CSMSG_CHANNEL_REGISTERED", intervalString(buffer, now - cData->registered, user->handle_info)); privileged = IsStaff(user); + if(privileged) + reply("CSMSG_CHANNEL_REGISTERED", intervalString(buffer, now - cData->registered, user->handle_info)); if(((uData && uData->access >= UL_COOWNER) || privileged) && cData->registrar) reply("CSMSG_CHANNEL_REGISTRAR", cData->registrar);