X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_shun.cpp;h=8bf4d30e7bf341d4d6ce773bc7c1734455bb586e;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=5e13f109005d7de5eb2a197513167f1bd588b020;hpb=84a1569cd60daa64b1ae52a1fff62c0dc4d78850;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index 5e13f1090..8bf4d30e7 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -30,10 +30,10 @@ class Shun : public XLine public: std::string matchtext; - Shun(time_t s_time, long d, std::string src, std::string re, std::string shunmask) + Shun(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& shunmask) : XLine(s_time, d, src, re, "SHUN") + , matchtext(shunmask) { - this->matchtext = shunmask; } ~Shun() @@ -108,8 +108,8 @@ class CommandShun : public Command std::string target = parameters[0]; - User *find = ServerInstance->FindNick(target.c_str()); - if (find) + User *find = ServerInstance->FindNick(target); + if ((find) && (find->registered == REG_ALL)) target = std::string("*!*@") + find->GetIPString(); if (parameters.size() == 1) @@ -168,6 +168,9 @@ class CommandShun : public Command RouteDescriptor GetRouting(User* user, const std::vector& parameters) { + if (IS_LOCAL(user)) + return ROUTE_LOCALONLY; // spanningtree will send ADDLINE + return ROUTE_BROADCAST; } }; @@ -188,7 +191,7 @@ class ModuleShun : public Module void init() { ServerInstance->XLines->RegisterFactory(&f); - ServerInstance->AddCommand(&cmd); + ServerInstance->Modules->AddService(cmd); Implementation eventlist[] = { I_OnStats, I_OnPreCommand, I_OnRehash }; ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));