Bug fix round-up for SF#2885593, SF#2924219 and SF#2946094.
authorMichael Poole <mdpoole@troilus.org>
Mon, 15 Feb 2010 20:28:59 +0000 (15:28 -0500)
committerMichael Poole <mdpoole@troilus.org>
Mon, 15 Feb 2010 20:28:59 +0000 (15:28 -0500)
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
src/mod-helpserv.c
src/proto-p10.c

index f61faa91657744373c44240c5512b4fd8dfd25a8..be5d739ccf6ddfa412d543ca8704679733cb2efb 100644 (file)
@@ -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)
     {
index 08010cc37ec2c231d961e119e0a0a16665f4b272..ed4db97e79e1e7a2cc1e457dbe9cb02379e738ea 100644 (file)
@@ -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;
index 86cd33574f645488914ec4dc9c998b1448043b6d..f6eb772525dd8b147ddb62520deb6779a4bb251c 100644 (file)
@@ -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);