X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/3b7fa78b1de8f9ee8718cba3da3b2db522b70620..1ccb8f6e37ca3c53da7ab48b3ded3ae332702e0b:/src/chanserv.c diff --git a/src/chanserv.c b/src/chanserv.c index e63f830..c56a5af 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -7474,6 +7474,7 @@ static CHANSERV_FUNC(cmd_unsuspend) REQUIRE_PARAMS(2); if(!(hi = modcmd_get_handle_info(user, argv[1]))) return 0; + actor = GetChannelUser(channel->channel_info, user->handle_info); real_actor = GetChannelAccess(channel->channel_info, user->handle_info); if(!(target = GetTrueChannelAccess(channel->channel_info, hi))) { @@ -7738,26 +7739,26 @@ static CHANSERV_FUNC(cmd_spin) } /* random time gline */ else if (!strcasecmp(wheel, "gline")) { - char target[IRC_NTOP_MAX_SIZE + 3]; + char target[HOSTLEN + 3]; int wtime = 120 + rand() % 600; strcpy(target, "*@"); strcat(target, user->hostname); send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_GLINE"); - gline_add(chanserv->nick, target, wtime, "Reward for spinning the wheel of misfortune!", now, now, 1, 0); + gline_add(chanserv->nick, target, wtime, "Reward for spinning the wheel of misfortune!", now, 1, 0); // irc_kill(chanserv, user, "Reward for spinning the wheel of misfortune!"); } /* random shun */ else if (!strcasecmp(wheel, "shun")) { - char target[IRC_NTOP_MAX_SIZE + 3]; + char target[HOSTLEN + 3]; int wtime = 120 + rand() % 600; strcpy(target, "*@"); strcat(target, user->hostname); send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_SHUN"); - shun_add(chanserv->nick, target, wtime, "Reward for spinning the wheel of misfortune!", now, now, 1); + shun_add(chanserv->nick, target, wtime, "Reward for spinning the wheel of misfortune!", now, 1); } /* absolutely nothing */ else if (!strcasecmp(wheel, "nothing")) { @@ -7849,7 +7850,7 @@ static CHANSERV_FUNC(cmd_spin) /* service ignore */ else if (!strcasecmp(wheel, "svsignore")) { int gagged, ignoretime = 0; - char target[IRC_NTOP_MAX_SIZE + 13]; + char target[HOSTLEN + 13]; if(IsOper(user)) { /* we cant gag opers, so just verbally abuse them */ @@ -7868,7 +7869,7 @@ static CHANSERV_FUNC(cmd_spin) else if (!strcasecmp(wheel, "kickbanall")) { unsigned int count, n; struct modeNode *mn; - //char ban[IRC_NTOP_MAX_SIZE + 1]; + //char ban[HOSTLEN + 1]; send_target_message(1, channel->name, chanserv, "CSMSG_SPIN_KICKBANALL"); @@ -8726,10 +8727,19 @@ handle_part(struct modeNode *mn, UNUSED_ARG(const char *reason)) if(IsHelping(mn->user) && IsSupportHelper(mn->user)) { unsigned int ii; - for(ii = 0; ii < chanserv_conf.support_channels.used; ++ii) - if(find_handle_in_channel(chanserv_conf.support_channels.list[ii], mn->user->handle_info, mn->user)) + for(ii = 0; ii < chanserv_conf.support_channels.used; ++ii) { + struct chanNode *channel; + struct userNode *exclude; + /* When looking at the channel that is being /part'ed, we + * have to skip over the client that is leaving. For + * other channels, we must not do that. + */ + channel = chanserv_conf.support_channels.list[ii]; + exclude = (channel == mn->channel) ? mn->user : NULL; + if(find_handle_in_channel(channel, mn->user->handle_info, exclude)) break; - if(ii == chanserv_conf.support_channels.used) + } + if(ii == chanserv_conf.support_channels.used) HANDLE_CLEAR_FLAG(mn->user->handle_info, HELPING); } }