X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_shun.cpp;h=dbc1812c700ce96e42f244097e1d13fa4d6bf40e;hb=19cc8380fb9060add68852e40846b10e4d1f18f5;hp=e7dc3086dd079b78569b66895a3d8525e64d0aca;hpb=4ab1c43c1eee708fc50a4808f714a731891b75e8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp index e7dc3086d..dbc1812c7 100644 --- a/src/modules/m_shun.cpp +++ b/src/modules/m_shun.cpp @@ -23,17 +23,15 @@ #include "inspircd.h" #include "xline.h" -/* $ModDesc: Provides the /SHUN command, which stops a user from executing all except configured commands. */ - 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; } bool Matches(User *u) @@ -56,9 +54,9 @@ public: return false; } - const char* Displayable() + const std::string& Displayable() { - return matchtext.c_str(); + return matchtext; } }; @@ -184,8 +182,6 @@ class ModuleShun : public Module ServerInstance->XLines->RegisterFactory(&f); ServerInstance->Modules->AddService(cmd); - Implementation eventlist[] = { I_OnStats, I_OnPreCommand, I_OnRehash }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); OnRehash(NULL); }