From 14001afa5d358a39a3347d65e16a86e8ee3756d1 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Mon, 15 Feb 2010 15:28:59 -0500 Subject: [PATCH] Bug fix round-up for SF#2885593, SF#2924219 and SF#2946094. Thanks to ZeRoFiGhter for finding and analyzing these. src/chanserv.c (cmd_move): Scan all users' presence in the new channel. (merge_users): Use the newer "seen" time when merging. Scan source users' presence in the new channel. (cmd_mdel_user): "actor" already considers whether the user is helping, so use that information. (handle_join): Allow queuing dynlimit updates during burst. src/mod-helpserv.c (handle_join): Fix request list indexing. src/proto-p10.c (irc_kill): Don't insert self in the kill path; our uplink does that (at least for ircu2.10.12.x). --- src/chanserv.c | 20 +++++++++++++++----- src/mod-helpserv.c | 2 +- src/proto-p10.c | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/chanserv.c b/src/chanserv.c index f61faa9..be5d739 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -2265,6 +2265,10 @@ static CHANSERV_FUNC(cmd_move) target->channel_info->channel = target; channel->channel_info = NULL; + /* Check whether users are present in the new channel. */ + for(uData = target->channel_info->users; uData; uData = uData->next) + scan_user_presence(uData, NULL); + reply("CSMSG_MOVE_SUCCESS", target->name); sprintf(reason, "%s moved to %s by %s.", channel->name, target->name, user->handle_info->handle); @@ -2315,6 +2319,11 @@ merge_users(struct chanData *source, struct chanData *target) choice = (suData->seen > tuData->seen) ? suData : tuData; else /* Otherwise, keep the higher access level. */ choice = (suData->access > tuData->access) ? suData : tuData; + /* Use the later seen time. */ + if(suData->seen < tuData->seen) + suData->seen = tuData->seen; + else + tuData->seen = suData->seen; /* Remove the user that wasn't picked. */ if(choice == tuData) @@ -2343,6 +2352,9 @@ merge_users(struct chanData *source, struct chanData *target) /* Update the user counts for the target channel; the source counts are left alone. */ target->userCount++; + + /* Check whether the user is in the target channel. */ + scan_user_presence(suData, NULL); } /* Possible to assert (source->users == NULL) here. */ @@ -2727,7 +2739,7 @@ cmd_mdel_user(struct userNode *user, struct chanNode *channel, unsigned short mi return 0; } - if((actor->access <= max_access) && !IsHelping(user)) + if(actor->access <= max_access) { reply("CSMSG_NO_ACCESS"); return 0; @@ -6498,11 +6510,9 @@ handle_join(struct modeNode *mNode) } } - /* ChanServ will not modify the limits in join-flooded channels. - It will also skip DynLimit processing when the user (or srvx) - is bursting in, because there are likely more incoming. */ + /* ChanServ will not modify the limits in join-flooded channels, + or when there are enough slots left below the limit. */ if((cData->flags & CHANNEL_DYNAMIC_LIMIT) - && !user->uplink->burst && !channel->join_flooded && (channel->limit - channel->members.used) < chanserv_conf.adjust_threshold) { diff --git a/src/mod-helpserv.c b/src/mod-helpserv.c index 08010cc..ed4db97 100644 --- a/src/mod-helpserv.c +++ b/src/mod-helpserv.c @@ -4024,7 +4024,7 @@ static int handle_join(struct modeNode *mNode) { if ((reqlist = dict_find(helpserv_reqs_bynick_dict, user->nick, NULL))) { for (j=0; j < reqlist->used; j++) - if (reqlist->list[i]->hs == hs) + if (reqlist->list[j]->hs == hs) break; if (j < reqlist->used) continue; diff --git a/src/proto-p10.c b/src/proto-p10.c index 86cd335..f6eb772 100644 --- a/src/proto-p10.c +++ b/src/proto-p10.c @@ -818,8 +818,8 @@ void irc_kill(struct userNode *from, struct userNode *target, const char *message) { if (from) { - putsock("%s " P10_KILL " %s :%s!%s (%s)", - from->numeric, target->numeric, self->name, from->nick, message); + putsock("%s " P10_KILL " %s :%s (%s)", + from->numeric, target->numeric, from->nick, message); } else { putsock("%s " P10_KILL " %s :%s (%s)", self->numeric, target->numeric, self->name, message); -- 2.20.1