fcntl(s, F_SETFL, flags | O_NONBLOCK);
}
-int CleanAndResolve (char *resolvedHost, const char *unresolvedHost, bool forward, unsigned long timeout)
-{
- bool ok;
- std::string ipaddr;
-
- DNS d(Config->DNSServer);
- if (forward)
- ok = d.ForwardLookup(unresolvedHost, false);
- else
- ok = d.ReverseLookup(unresolvedHost, false);
- if (!ok)
- return 0;
- time_t T = time(NULL)+timeout;
- while ((!d.HasResult()) && (time(NULL)<T));
- if (forward)
- ipaddr = d.GetResultIP();
- else
- ipaddr = d.GetResult();
- strlcpy(resolvedHost,ipaddr.c_str(),MAXBUF);
- return (ipaddr != "");
-}
-
int c_count(userrec* u)
{
int z = 0;
* If the channel is NOT private/secret OR the user shares a common channel
* If the user is an oper, and the <options:operspywhois> option is set.
*/
- if ((source == user) || (*source->oper && Config->OperSpyWhois) || (((!rec->channel->modes[CM_PRIVATE]) && (!rec->channel->modes[CM_SECRET]) && !(user->modes[UM_INVISIBLE])) || (rec->channel->HasUser(source))))
+ if ((source == user) || (*source->oper && Config->OperSpyWhois) || (((!rec->channel->modes[CM_PRIVATE]) && (!rec->channel->modes[CM_SECRET])) || (rec->channel->HasUser(source))))
{
list.append(cmode(user, rec->channel)).append(rec->channel->name).append(" ");
}