X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cban.cpp;h=54b1e39eed66e65761b1224108f34339677de96c;hb=4132a44396d8fa3d23f87b5cbea5b928aa09769f;hp=2a969bec7cb594666bd6d5d5b8680773fc241f24;hpb=761e6d75ba37b984998952940ed681e79e456142;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index 2a969bec7..54b1e39ee 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -28,33 +28,29 @@ class CBan : public XLine { private: - std::string displaytext; - irc::string matchtext; + std::string matchtext; public: CBan(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& ch) : XLine(s_time, d, src, re, "CBAN") + , matchtext(ch) { - this->displaytext = ch; - this->matchtext = ch.c_str(); } // XXX I shouldn't have to define this - bool Matches(User *u) + bool Matches(User* u) CXX11_OVERRIDE { return false; } - bool Matches(const std::string &s) + bool Matches(const std::string& s) CXX11_OVERRIDE { - if (matchtext == s) - return true; - return false; + return irc::equals(matchtext, s); } - const std::string& Displayable() + const std::string& Displayable() CXX11_OVERRIDE { - return displaytext; + return matchtext; } }; @@ -67,12 +63,12 @@ class CBanFactory : public XLineFactory /** Generate a CBAN */ - XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) + XLine* Generate(time_t set_time, long duration, std::string source, std::string reason, std::string xline_specific_mask) CXX11_OVERRIDE { return new CBan(set_time, duration, source, reason, xline_specific_mask); } - bool AutoApplyToUserList(XLine *x) + bool AutoApplyToUserList(XLine* x) CXX11_OVERRIDE { return false; // No, we apply to channels. } @@ -88,7 +84,7 @@ class CommandCBan : public Command flags_needed = 'o'; this->syntax = " [ :]"; } - CmdResult Handle(const std::vector ¶meters, User *user) + CmdResult Handle(const std::vector& parameters, User* user) CXX11_OVERRIDE { /* syntax: CBAN #channel time :reason goes here */ /* 'time' is a human-readable timestring, like 2d3h2s. */ @@ -135,7 +131,7 @@ class CommandCBan : public Command return CMD_SUCCESS; } - RouteDescriptor GetRouting(User* user, const std::vector& parameters) + RouteDescriptor GetRouting(User* user, const std::vector& parameters) CXX11_OVERRIDE { if (IS_LOCAL(user)) return ROUTE_LOCALONLY; // spanningtree will send ADDLINE