]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_knock.cpp
Pass the ModeHandler to User::HasModePermission()
[user/henk/code/inspircd.git] / src / modules / m_knock.cpp
index 545c2dc14c11232202959ce7e3916a55578f15f9..cf623c4abdd2e1c12c1d0553f9b65e8af4afb356 100644 (file)
@@ -68,7 +68,7 @@ class CommandKnock : public Command
                }
 
                if (sendnotice)
-                       c->WriteChannelWithServ(ServerInstance->Config->ServerName, "NOTICE %s :User %s is KNOCKing on %s (%s)", c->name.c_str(), user->nick.c_str(), c->name.c_str(), parameters[1].c_str());
+                       c->WriteNotice(InspIRCd::Format("User %s is KNOCKing on %s (%s)", user->nick.c_str(), c->name.c_str(), parameters[1].c_str()));
 
                if (sendnumeric)
                        c->WriteChannelWithServ(ServerInstance->Config->ServerName, "710 %s %s %s :is KNOCKing: %s", c->name.c_str(), c->name.c_str(), user->GetFullHost().c_str(), parameters[1].c_str());
@@ -98,14 +98,12 @@ class ModuleKnock : public Module
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                std::string knocknotify = ServerInstance->Config->ConfValue("knock")->getString("notify");
-               irc::string notify(knocknotify.c_str());
-
-               if (notify == "numeric")
+               if (stdalgo::string::equalsci(knocknotify, "numeric"))
                {
                        cmd.sendnotice = false;
                        cmd.sendnumeric = true;
                }
-               else if (notify == "both")
+               else if (stdalgo::string::equalsci(knocknotify, "both"))
                {
                        cmd.sendnotice = true;
                        cmd.sendnumeric = true;