X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_svshold.cpp;h=fc1eb5381a84505395b2c9954f190cc75f027178;hb=e950f568d0f571e9475aa38177486468714de4d3;hp=bd80bb048b72b924229ada9bfa1f43cb0bd17227;hpb=4ab1c43c1eee708fc50a4808f714a731891b75e8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index bd80bb048..fc1eb5381 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -23,19 +23,17 @@ #include "inspircd.h" #include "xline.h" -/* $ModDesc: Implements SVSHOLD. Like Q:Lines, but can only be added/removed by Services. */ - /** Holds a SVSHold item */ class SVSHold : public XLine { public: - irc::string nickname; + std::string nickname; - SVSHold(time_t s_time, long d, std::string src, std::string re, std::string nick) + SVSHold(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& nick) : XLine(s_time, d, src, re, "SVSHOLD") { - this->nickname = nick.c_str(); + this->nickname = nick; } bool Matches(User *u) @@ -47,14 +45,12 @@ public: bool Matches(const std::string &s) { - if (nickname == s) - return true; - return false; + return InspIRCd::Match(s, nickname); } - const char* Displayable() + const std::string& Displayable() { - return nickname.c_str(); + return nickname; } }; @@ -86,7 +82,6 @@ class CommandSvshold : public Command CommandSvshold(Module* Creator) : Command(Creator, "SVSHOLD", 1) { flags_needed = 'o'; this->syntax = " [ :]"; - TRANSLATE4(TR_TEXT, TR_TEXT, TR_TEXT, TR_END); } CmdResult Handle(const std::vector ¶meters, User *user) @@ -163,8 +158,6 @@ class ModuleSVSHold : public Module { ServerInstance->XLines->RegisterFactory(&s); ServerInstance->Modules->AddService(cmd); - Implementation eventlist[] = { I_OnUserPreNick, I_OnStats }; - ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ModResult OnStats(char symbol, User* user, string_list &out) CXX11_OVERRIDE