-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)
-{
- std::string cmp = "";
- std::string lst = "";
- if (!user || !source)
- {
- return lst;
- }
- bool userinvisible = (user->modebits & UM_INVISIBLE);
- for (std::vector<ucrec*>::const_iterator i = user->chans.begin(); i != user->chans.end(); i++)
- {
- if ((((ucrec*)(*i))->channel != NULL) && (((ucrec*)(*i))->channel->name))
- {
- cmp = std::string(((ucrec*)(*i))->channel->name) + " ";
- if (!strstr(lst.c_str(),cmp.c_str()))
- {
- // 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, shortcircuit the comparison.
- if ((source == user) || ((((!(((ucrec*)(*i))->channel->binarymodes & CM_PRIVATE)) && (!(((ucrec*)(*i))->channel->binarymodes & CM_SECRET)) && (!userinvisible)) || (((ucrec*)(*i))->channel->HasUser(source)))))
- {
- lst = lst + std::string(cmode(user,((ucrec*)(*i))->channel)) + std::string(((ucrec*)(*i))->channel->name) + " ";
- }
- }
- }
- }
- return lst;
-}
-