X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cloaking.cpp;h=ccc98e557e7ca96e99ff5b26c0c4b8c6c55ca25e;hb=3a01b55a118d4937b75541fbf385180f7106fa12;hp=5bec93f034cdc1bee2832fa0e7b48184e131db0a;hpb=26e7bb0b9a17a595d9935a1cae41b44504ad213e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 5bec93f03..ccc98e557 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -24,7 +24,7 @@ #include "inspircd.h" -#include "hash.h" +#include "modules/hash.h" /* $ModDesc: Provides masking of user hostnames */ @@ -148,7 +148,7 @@ class ModuleCloaking : public Module { } - void init() + void init() CXX11_OVERRIDE { OnRehash(NULL); @@ -284,7 +284,7 @@ class ModuleCloaking : public Module return rv; } - ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask) + ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask) CXX11_OVERRIDE { LocalUser* lu = IS_LOCAL(user); if (!lu) @@ -295,9 +295,8 @@ class ModuleCloaking : public Module /* Check if they have a cloaked host, but are not using it */ if (cloak && *cloak != user->dhost) { - char cmask[MAXBUF]; - snprintf(cmask, MAXBUF, "%s!%s@%s", user->nick.c_str(), user->ident.c_str(), cloak->c_str()); - if (InspIRCd::Match(cmask,mask)) + const std::string cloakMask = user->nick + "!" + user->ident + "@" + *cloak; + if (InspIRCd::Match(cloakMask, mask)) return MOD_RES_DENY; } return MOD_RES_PASSTHRU; @@ -311,7 +310,7 @@ class ModuleCloaking : public Module // this unsets umode +x on every host change. If we are actually doing a +x // mode change, we will call SetMode back to true AFTER the host change is done. - void OnChangeHost(User* u, const std::string& host) + void OnChangeHost(User* u, const std::string& host) CXX11_OVERRIDE { if(u->IsModeSet('x')) { @@ -320,7 +319,7 @@ class ModuleCloaking : public Module } } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { std::string testcloak = "broken"; if (Hash) @@ -337,7 +336,7 @@ class ModuleCloaking : public Module return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak); } - void OnRehash(User* user) + void OnRehash(User* user) CXX11_OVERRIDE { ConfigTag* tag = ServerInstance->Config->ConfValue("cloak"); prefix = tag->getString("prefix"); @@ -377,7 +376,7 @@ class ModuleCloaking : public Module return chost; } - void OnUserConnect(LocalUser* dest) + void OnUserConnect(LocalUser* dest) CXX11_OVERRIDE { std::string* cloak = cu.ext.get(dest); if (cloak) @@ -398,7 +397,7 @@ CmdResult CommandCloak::Handle(const std::vector ¶meters, User else cloak = mod->GenCloak(sa, "", parameters[0]); - user->WriteServ("NOTICE %s :*** Cloak for %s is %s", user->nick.c_str(), parameters[0].c_str(), cloak.c_str()); + user->WriteNotice("*** Cloak for " + parameters[0] + " is " + cloak); return CMD_SUCCESS; }