X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_namedmodes.cpp;h=3e27092a7fbb1ec1e329fe5eb9117cd3859b9baf;hb=623ba6ae49f8e1e0958f921fa178af8a95797c1c;hp=8233f4357b061bf2b62ad42f45180670c57f3736;hpb=fcacc8e0306382bc3f938073092c3729d77e2b41;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index 8233f4357..3e27092a7 100644 --- a/src/modules/m_namedmodes.cpp +++ b/src/modules/m_namedmodes.cpp @@ -17,6 +17,8 @@ */ +/* $ModDesc: Provides the ability to manipulate modes via long names. */ + #include "inspircd.h" static void DisplayList(User* user, Channel* channel) @@ -33,9 +35,8 @@ static void DisplayList(User* user, Channel* channel) if (mh->GetNumParams(true)) items << " " << channel->GetModeParameter(letter); } - char pfx[MAXBUF]; - snprintf(pfx, MAXBUF, ":%s 961 %s %s", ServerInstance->Config->ServerName.c_str(), user->nick.c_str(), channel->name.c_str()); - user->SendText(std::string(pfx), items); + const std::string line = ":" + ServerInstance->Config->ServerName + " 961 " + user->nick + " " + channel->name; + user->SendText(line, items); user->WriteNumeric(960, "%s %s :End of mode list", user->nick.c_str(), channel->name.c_str()); } @@ -104,16 +105,16 @@ class ModuleNamedModes : public Module { } - void init() + void init() CXX11_OVERRIDE { ServerInstance->Modules->AddService(cmd); ServerInstance->Modules->AddService(dummyZ); Implementation eventlist[] = { I_OnPreMode }; - ServerInstance->Modules->Attach(eventlist, this, 1); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } - Version GetVersion() + Version GetVersion() CXX11_OVERRIDE { return Version("Provides the ability to manipulate modes via long names.",VF_VENDOR); } @@ -123,7 +124,7 @@ class ModuleNamedModes : public Module ServerInstance->Modules->SetPriority(this, I_OnPreMode, PRIORITY_FIRST); } - ModResult OnPreMode(User* source, User* dest, Channel* channel, const std::vector& parameters) + ModResult OnPreMode(User* source, User* dest, Channel* channel, const std::vector& parameters) CXX11_OVERRIDE { if (!channel) return MOD_RES_PASSTHRU;