-void userlist(userrec *user,chanrec *c)
-{
- if ((!c) || (!user))
- {
- log(DEFAULT,"*** BUG *** userlist was given an invalid parameter");
- return;
- }
-
- size_t dlen = snprintf(list,MAXBUF,"353 %s = %s :", user->nick, c->name);
- size_t initial = dlen;
-
- std::map<char*,char*> *ulist= c->GetUsers();
-
- for (std::map<char*,char*>::iterator i = ulist->begin(); i != ulist->end(); i++)
- {
- char* o = i->second;
- userrec* otheruser = (userrec*)o;
- if ((!has_channel(user,c)) && (strchr(otheruser->modes,'i')))
- {
- /* user is +i, and source not on the channel, does not show
- * nick in NAMES list */
- continue;
- }
- dlen += strlcat(list,cmode(otheruser,c),MAXBUF);
- dlen += strlcat(list,otheruser->nick,MAXBUF);
- charlcat(list,' ',MAXBUF);
- dlen++;
- if (dlen > (480-NICKMAX))
- {
- /* list overflowed into
- * multiple numerics */
- WriteServ_NoFormat(user->fd,list);
- dlen = snprintf(list,MAXBUF,"353 %s = %s :", user->nick, c->name);
- }
- }
- /* if whats left in the list isnt empty, send it */
- if (dlen != initial)
- {
- WriteServ_NoFormat(user->fd,list);
- }
-}
-
-/* return a count of the users on a specific channel accounting for
- * invisible users who won't increase the count. e.g. for /LIST */
-
-int usercount_i(chanrec *c)
-{
- if (!c)
- return 0;
-
- int count = 0;
- std::map<char*,char*> *ulist= c->GetUsers();
- for (std::map<char*,char*>::iterator i = ulist->begin(); i != ulist->end(); i++)