]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_silence.cpp
Added ability to update the helpop file on rehash (Bug #69)
[user/henk/code/inspircd.git] / src / modules / m_silence.cpp
index a73ec757d02c70b302c431dabea5bf6b3ff93264..c423506a0c5338aebf68c8b2198b6acaa15772ef 100644 (file)
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include <stdio.h>
 #include <string>
 #include <vector>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
+#include "helperfuncs.h"
+#include "hashcomp.h"
 
 /* $ModDesc: Provides support for the /SILENCE command */
 
@@ -65,7 +69,9 @@ void handle_silence(char **parameters, int pcnt, userrec *user)
                                        for (silencelist::iterator i = sl->begin(); i != sl->end(); i++)
                                                {
                                                // search through for the item
-                                                       if (!strcasecmp(i->c_str(),nick))
+                                               irc::string listitem = i->c_str();
+                                               irc::string target = nick;
+                                               if (listitem == target)
                                                        {
                                                                sl->erase(i);
                                                        WriteServ(user->fd,"950 %s %s :Removed %s!*@* from silence list",user->nick, user->nick,nick);
@@ -97,7 +103,9 @@ void handle_silence(char **parameters, int pcnt, userrec *user)
                        // add the nick to it -- silence only takes nicks for some reason even though its list shows masks
                        for (silencelist::iterator n = sl->begin(); n != sl->end();  n++)
                        {
-                               if (!strcasecmp(n->c_str(),nick))
+                               irc::string listitem = n->c_str();
+                               irc::string target = nick;
+                               if (listitem == target)
                                {
                                        WriteServ(user->fd,"952 %s %s :%s is already on your silence list",user->nick, user->nick,nick);
                                        return;
@@ -155,7 +163,9 @@ class ModuleSilence : public Module
                        {
                                for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
                                {
-                                       if (!strcasecmp(c->c_str(),user->nick))
+                                        irc::string listitem = c->c_str();
+                                        irc::string target = user->nick;
+                                        if (listitem == target)
                                        {
                                                return 1;
                                        }
@@ -175,7 +185,9 @@ class ModuleSilence : public Module
                         {
                                 for (silencelist::const_iterator c = sl->begin(); c != sl->end(); c++)
                                 {
-                                        if (!strcasecmp(c->c_str(),user->nick))
+                                        irc::string listitem = c->c_str();
+                                        irc::string target = user->nick;
+                                        if (listitem == target)
                                         {
                                                 return 1;
                                         }
@@ -192,7 +204,7 @@ class ModuleSilence : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0);
+               return Version(1,0,0,1,VF_VENDOR);
        }
 };