-void TidyBan(char *ban)
-{
- if (!ban) {
- log(DEFAULT,"*** BUG *** TidyBan was given an invalid parameter");
- return;
- }
-
- char temp[MAXBUF],NICK[MAXBUF],IDENT[MAXBUF],HOST[MAXBUF];
-
- strlcpy(temp,ban,MAXBUF);
-
- char* pos_of_pling = strchr(temp,'!');
- char* pos_of_at = strchr(temp,'@');
-
- pos_of_pling[0] = '\0';
- pos_of_at[0] = '\0';
- pos_of_pling++;
- pos_of_at++;
-
- strlcpy(NICK,temp,NICKMAX-1);
- strlcpy(IDENT,pos_of_pling,IDENTMAX+1);
- strlcpy(HOST,pos_of_at,63);
-
- snprintf(ban,MAXBUF,"%s!%s@%s",NICK,IDENT,HOST);
-}
-
-char lst[MAXBUF];
-
-std::string chlist(userrec *user,userrec* source)
-{
- /* Should this be a stringstream? Not sure if it would be faster as streams are more oriented at appending stuff, which is all we do */
- std::string lst;
-
- if (!user || !source)
- {
- return lst;
- }
-
- for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
- {
- ucrec* rec = *i;
-
- if(rec->channel && rec->channel->name)
- {
- /* XXX - Why does this check need to be here at all? :< */
- /* Commenting this out until someone finds a case where we need it */
- //if (lst.find(rec->channel->name) == std::string::npos)
- //{
- // if the channel is NOT private/secret, OR the source user is on the channel, AND the user is not invisible.
- // if the user is the same as the source or is an oper, shortcircuit the comparison.
- if ((source == user) || (*source->oper && Config->OperSpyWhois) || (((!rec->channel->modes[CM_PRIVATE]) && (!rec->channel->modes[CM_SECRET]) && !(user->modebits & UM_INVISIBLE)) || (rec->channel->HasUser(source))))
- {
- lst += cmode(user, rec->channel);
- lst += rec->channel->name;
- lst += " ";
- }
- //}
- }
- }
-
- return lst;
-}