X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_customtitle.cpp;h=3386e8cd7ca35a38e5c349b2a97ea59c8ae517ab;hb=8af4a2795befd73e1b3bf048560054d8fb7fc0f4;hp=5d088e9a6f8ca93abbf8ba194b15b94ae1534c06;hpb=d9d99cd02dadf34bfcc220734ba0c422f0acb3e6;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index 5d088e9a6..3386e8cd7 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -21,8 +21,6 @@ #include "inspircd.h" -/* $ModDesc: Provides the TITLE command which allows setting of CUSTOM WHOIS TITLE line */ - /** Handle /TITLE */ class CommandTitle : public Command @@ -50,7 +48,7 @@ class CommandTitle : public Command std::string title = i->second->getString("title"); std::string vhost = i->second->getString("vhost"); - if (Name == parameters[0] && !ServerInstance->PassCompare(user, pass, parameters[1], hash) && + if (Name == parameters[0] && ServerInstance->PassCompare(user, pass, parameters[1], hash) && InspIRCd::MatchMask(host, userHost, userIP) && !title.empty()) { ctitle.set(user, title); @@ -58,7 +56,7 @@ class CommandTitle : public Command ServerInstance->PI->SendMetaData(user, "ctitle", title); if (!vhost.empty()) - user->ChangeDisplayedHost(vhost.c_str()); + user->ChangeDisplayedHost(vhost); user->WriteNotice("Custom title set to '" + title + "'"); @@ -81,13 +79,6 @@ class ModuleCustomTitle : public Module { } - void init() CXX11_OVERRIDE - { - ServerInstance->Modules->AddService(cmd); - ServerInstance->Modules->AddService(cmd.ctitle); - ServerInstance->Modules->Attach(I_OnWhoisLine, this); - } - // :kenny.chatspike.net 320 Brain Azhrarn :is getting paid to play games. ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE { @@ -98,7 +89,7 @@ class ModuleCustomTitle : public Module const std::string* ctitle = cmd.ctitle.get(dest); if (ctitle) { - ServerInstance->SendWhoisLine(user, dest, 320, "%s %s :%s",user->nick.c_str(), dest->nick.c_str(), ctitle->c_str()); + ServerInstance->SendWhoisLine(user, dest, 320, "%s :%s", dest->nick.c_str(), ctitle->c_str()); } } /* Don't block anything */