X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_watch.cpp;h=6e9ab6a586ed71e5b0e5457e2ef7d1ba8670ba81;hb=45805210f8c9bbce6222c50863a1671f562ccfbb;hp=3ae856b5e7ac6d9d8704743d6cf76868806862c7;hpb=e3bd782207f50d131acd008b0cbcc7545aac7690;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index 3ae856b5e..6e9ab6a58 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -49,7 +49,7 @@ * * KEY: Brain ---> Watched by: Boo, w00t, Om * KEY: Boo ---> Watched by: Brain, w00t - * + * * This is used when we want to tell all the users that are watching someone that * they are now available or no longer available. For example, if the hash was * populated as shown above, then when Brain signs on, messages are sent to Boo, w00t @@ -114,16 +114,16 @@ class CommandSVSWatch : public Command { if (!ServerInstance->ULine(user->server)) return CMD_FAILURE; - + User *u = ServerInstance->FindNick(parameters[0]); if (!u) return CMD_FAILURE; - + if (IS_LOCAL(u)) { ServerInstance->Parser->CallHandler("WATCH", parameters, u); } - + return CMD_SUCCESS; } }; @@ -137,7 +137,7 @@ class CommandWatch : public Command CmdResult remove_watch(User* user, const char* nick) { // removing an item from the list - if (!ServerInstance->IsNick(nick)) + if (!ServerInstance->IsNick(nick, ServerInstance->Config->Limits.NickMax)) { user->WriteNumeric(942, "%s %s :Invalid nickname", user->nick.c_str(), nick); return CMD_FAILURE; @@ -191,7 +191,7 @@ class CommandWatch : public Command CmdResult add_watch(User* user, const char* nick) { - if (!ServerInstance->IsNick(nick)) + if (!ServerInstance->IsNick(nick, ServerInstance->Config->Limits.NickMax)) { user->WriteNumeric(942, "%s %s :Invalid nickname",user->nick.c_str(),nick); return CMD_FAILURE; @@ -373,7 +373,7 @@ class Modulewatch : public Module CommandWatch* mycommand; CommandSVSWatch *sw; unsigned int maxwatch; - + public: Modulewatch(InspIRCd* Me) : Module(Me), maxwatch(32) @@ -457,7 +457,7 @@ class Modulewatch : public Module if (n != i2->second.end()) /* I'm no longer watching you... */ i2->second.erase(n); - + if (!i2->second.size()) whos_watching_me->erase(user->nick.c_str()); } @@ -545,22 +545,22 @@ class Modulewatch : public Module } } } - } + } virtual void On005Numeric(std::string &output) { // we don't really have a limit... output = output + " WATCH=" + ConvToStr(maxwatch); } - + virtual ~Modulewatch() { delete whos_watching_me; } - + virtual Version GetVersion() { - return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); } };