X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_hostname_lookup.cpp;h=c26d3b3d32fc82e5e5f0d3f756f5436eb3d98642;hb=11916574f67962dce1d7a2fdf7ef6a3d2d1fa49f;hp=71a32e610102d06dda98aecae1b5fbdb2fa2a6e3;hpb=3e105c6311c23787ff54388c8d21c8ac1a01fd57;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_hostname_lookup.cpp b/src/commands/cmd_hostname_lookup.cpp index 71a32e610..c26d3b3d3 100644 --- a/src/commands/cmd_hostname_lookup.cpp +++ b/src/commands/cmd_hostname_lookup.cpp @@ -92,7 +92,7 @@ class UserResolver : public DNS::Request catch (DNS::Exception& e) { delete res_forward; - ServerInstance->Logs->Log("RESOLVER", LOG_DEBUG, "Error in resolver: %s",e.GetReason()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Error in resolver: " + e.GetReason()); bound_user->WriteNotice("*** There was an internal error resolving your host, using your IP address (" + bound_user->GetIPString() + ") instead."); dl->set(bound_user, 0); @@ -191,19 +191,9 @@ class ModuleHostnameLookup : public Module ph = &ptrHosts; } - void init() - { - OnRehash(NULL); - ServerInstance->Modules->AddService(this->dnsLookup); - ServerInstance->Modules->AddService(this->ptrHosts); - - Implementation i[] = { I_OnUserInit, I_OnCheckReady }; - ServerInstance->Modules->Attach(i, this, sizeof(i) / sizeof(Implementation)); - } - void OnUserInit(LocalUser *user) { - if (!DNS || user->MyClass->nouserdns) + if (!DNS || !user->MyClass->resolvehostnames) { user->WriteNotice("*** Skipping host resolution (disabled by server administrator)"); return; @@ -224,7 +214,7 @@ class ModuleHostnameLookup : public Module { this->dnsLookup.set(user, 0); delete res_reverse; - ServerInstance->Logs->Log("USERS", LOG_DEBUG, "Error in resolver: %s", e.GetReason()); + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Error in resolver: " + e.GetReason()); ServerInstance->stats->statsDnsBad++; } }