Track in-progress LISTs by next hash bucket to send, rather than a
[ircu2.10.12-pk.git] / ircd / channel.c
index c5f01b45cf54aa541f2f9348b5b9c0d0468ca773..01813ca50c47f513e5d265f0f6d25e059ce6079c 100644 (file)
@@ -291,21 +291,6 @@ int destruct_channel(struct Channel* chptr)
 
   assert(0 == chptr->members);
 
-  /* Channel became (or was) empty: Remove channel */
-  if (is_listed(chptr))
-  {
-    int i;
-    for (i = 0; i <= HighestFd; i++)
-    {
-      struct Client *acptr = 0;
-      if ((acptr = LocalClientArray[i]) && cli_listing(acptr) &&
-          (cli_listing(acptr))->chptr == chptr)
-      {
-        list_next_channels(acptr, 1);
-        break;                  /* Only one client can list a channel */
-      }
-    }
-  }
   /*
    * Now, find all invite links from channel structure
    */
@@ -1577,58 +1562,6 @@ void del_invite(struct Client *cptr, struct Channel *chptr)
     }
 }
 
-/** List a set of channels
- * Lists a series of channels that match a filter, skipping channels that 
- * have been listed before.
- *
- * @param cptr Client to send the list to.
- * @param nr   Number of channels to send this update.
- */
-void list_next_channels(struct Client *cptr, int nr)
-{
-  struct ListingArgs *args = cli_listing(cptr);
-  struct Channel *chptr = args->chptr;
-  chptr->mode.mode &= ~MODE_LISTED;
-  while (is_listed(chptr) || --nr >= 0)
-  {
-    for (; chptr; chptr = chptr->next)
-    {
-      if (!cli_user(cptr))
-        continue;
-      if (!(HasPriv(cptr, PRIV_LIST_CHAN) && IsAnOper(cptr)) && 
-          SecretChannel(chptr) && !find_channel_member(cptr, chptr))
-        continue;
-      if (chptr->users > args->min_users && chptr->users < args->max_users &&
-          chptr->creationtime > args->min_time &&
-          chptr->creationtime < args->max_time &&
-          (!(args->flags & LISTARG_TOPICLIMITS) || (*chptr->topic &&
-          chptr->topic_time > args->min_topic_time &&
-          chptr->topic_time < args->max_topic_time)))
-      {
-        if ((args->flags & LISTARG_SHOWSECRET) || ShowChannel(cptr,chptr))
-         send_reply(cptr, RPL_LIST, chptr->chname, chptr->users,
-                    chptr->topic);
-        chptr = chptr->next;
-        break;
-      }
-    }
-    if (!chptr)
-    {
-      MyFree(cli_listing(cptr));
-      cli_listing(cptr) = NULL;
-      send_reply(cptr, RPL_LISTEND);
-      break;
-    }
-  }
-  if (chptr)
-  {
-    (cli_listing(cptr))->chptr = chptr;
-    chptr->mode.mode |= MODE_LISTED;
-  }
-
-  update_write(cptr);
-}
-
 /** @page zombie Explaination of Zombies
  *
  * Consider: