X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_customtitle.cpp;h=4cfbeb7151a30b3b7dce1533fb728bacb83b18fa;hb=95fd083b589d7b16df98fe00711e8ac2cf9cc871;hp=b15b308d080d7e6e9859672af1bc343cb91ae322;hpb=d185decae97752368d5cf62311cbc0d1a52aa22c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_customtitle.cpp b/src/modules/m_customtitle.cpp index b15b308d0..4cfbeb715 100644 --- a/src/modules/m_customtitle.cpp +++ b/src/modules/m_customtitle.cpp @@ -2,7 +2,7 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team + * InspIRCd: (C) 2002-2009 InspIRCd Development Team * See: http://www.inspircd.org/wiki/index.php/Credits * * This program is free but copyrighted software; see @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" /* $ModDesc: Provides the TITLE command which allows setting of CUSTOM WHOIS TITLE line */ @@ -34,7 +33,7 @@ class CommandTitle : public Command std::string xhost; while (hl >> xhost) { - if (match(host, xhost) || match(ip,xhost, true)) + if (InspIRCd::Match(host, xhost, ascii_case_insensitive_map) || InspIRCd::MatchCIDR(ip, xhost, ascii_case_insensitive_map)) { return true; } @@ -66,9 +65,7 @@ class CommandTitle : public Command if (!strcmp(name.c_str(),parameters[0].c_str()) && !ServerInstance->PassCompare(user, pass.c_str(), parameters[1].c_str(), hash.c_str()) && OneOfMatches(TheHost,TheIP,host.c_str()) && !title.empty()) { std::string* text; - user->GetExt("ctitle", text); - - if (text) + if (user->GetExt("ctitle", text)) { user->Shrink("ctitle"); delete text; @@ -125,8 +122,7 @@ class ModuleCustomTitle : public Module { /* Insert our numeric before 312 */ std::string* ctitle; - dest->GetExt("ctitle", ctitle); - if (ctitle) + if (dest->GetExt("ctitle", ctitle)) { ServerInstance->SendWhoisLine(user, dest, 320, "%s %s :%s",user->nick.c_str(), dest->nick.c_str(), ctitle->c_str()); } @@ -147,8 +143,7 @@ class ModuleCustomTitle : public Module { // check if this user has an ctitle field to send std::string* ctitle; - user->GetExt("ctitle", ctitle); - if (ctitle) + if (user->GetExt("ctitle", ctitle)) { // call this function in the linking module, let it format the data how it // sees fit, and send it on its way. We dont need or want to know how. @@ -161,8 +156,7 @@ class ModuleCustomTitle : public Module virtual void OnUserQuit(User* user, const std::string &message, const std::string &oper_message) { std::string* ctitle; - user->GetExt("ctitle", ctitle); - if (ctitle) + if (user->GetExt("ctitle", ctitle)) { user->Shrink("ctitle"); delete ctitle; @@ -176,8 +170,7 @@ class ModuleCustomTitle : public Module { User* user = (User*)item; std::string* ctitle; - user->GetExt("ctitle", ctitle); - if (ctitle) + if (user->GetExt("ctitle", ctitle)) { user->Shrink("ctitle"); delete ctitle; @@ -214,7 +207,7 @@ class ModuleCustomTitle : public Module virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } };