]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_watch.cpp
Tidyup
[user/henk/code/inspircd.git] / src / modules / m_watch.cpp
index a8b50d025811341adbe7585f2876e66c6bbbb419..e60196c009e7e9e0fc6bd5cd975df396f2d22791 100644 (file)
@@ -22,15 +22,13 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-
 #include "hashcomp.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for the /watch command */
 
-
-
-
+/** A watchlist entry
+ */
 class watchentry : public classbase
 {
  public:
@@ -41,16 +39,18 @@ class watchentry : public classbase
 typedef std::vector<watchentry*> watchlist;
 watchlist watches;
 
+/** Handle /WATCH
+ */
 class cmd_watch : public command_t
 {
  public:
- cmd_watch (InspIRCd* Instance) : command_t(Instance,"WATCH",0,0)
      cmd_watch (InspIRCd* Instance) : command_t(Instance,"WATCH",0,0)
        {
                this->source = "m_watch.so";
                syntax = "[C|L|S]|[+|-<nick>]";
        }
 
-       void Handle (const char** parameters, int pcnt, userrec *user)
+       CmdResult Handle (const char** parameters, int pcnt, userrec *user)
        {
                if (!pcnt)
                {
@@ -133,7 +133,7 @@ class cmd_watch : public command_t
                                        if (!ServerInstance->IsNick(nick))
                                        {
                                                user->WriteServ("942 %s %s :Invalid nickname",user->nick,nick);
-                                               return;
+                                               return CMD_FAILURE;
                                        }
                                        irc::string n1 = nick;
                                        for (watchlist::iterator q = watches.begin(); q != watches.end(); q++)
@@ -166,7 +166,7 @@ class cmd_watch : public command_t
                                        if (!ServerInstance->IsNick(nick))
                                        {
                                                user->WriteServ("942 %s %s :Invalid nickname",user->nick,nick);
-                                               return;
+                                               return CMD_FAILURE;
                                        }
                                        irc::string n1 = nick;
                                        bool exists = false;
@@ -203,7 +203,8 @@ class cmd_watch : public command_t
                                }
                        }
                }
-               return;
+               /* So that spanningtree doesnt pass the WATCH commands to the network! */
+               return CMD_FAILURE;
        }
 };
 
@@ -309,7 +310,7 @@ class Modulewatch : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_VENDOR);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
 };