diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-15 18:04:41 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-05-15 18:04:41 +0000 |
commit | 82503a6b82042fb6d648690c8505dd31c6c057df (patch) | |
tree | 4c845284ddd2f31400fa8152a500e7a927f30ddc | |
parent | 4d5a17380bc71cabe544b41c7c8a26a292384f3d (diff) |
Made modules use irc::string where they were using strcasecmp()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1397 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_nicklock.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_nonicks.cpp | 5 | ||||
-rw-r--r-- | src/modules/m_silence.cpp | 17 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 11 |
4 files changed, 30 insertions, 8 deletions
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index b96105af7..336a008c9 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -20,6 +20,7 @@ #include "channels.h" #include "modules.h" #include "helperfuncs.h" +#include "hashcomp.h" /* $ModDesc: Provides the NICKLOCK command, allows an oper to chage a users nick and lock them to it until they quit */ @@ -39,7 +40,9 @@ void handle_nicklock(char **parameters, int pcnt, userrec *user) } if (Srv->IsNick(std::string(parameters[1]))) { - if (!strcasecmp(user->server,Srv->GetServerName().c_str())) + irc::string server = user->server; + irc::string me = Srv->GetServerName().c_str(); + if (server == me) { // give them a lock flag Srv->SendOpers(std::string(user->nick)+" used NICKLOCK to change and hold "+std::string(parameters[0])+" to "+parameters[1]); diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index 582a87626..3591b954d 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -20,6 +20,7 @@ #include "channels.h" #include "modules.h" #include "helperfuncs.h" +#include "hashcomp.h" /* $ModDesc: Provides support for unreal-style GLOBOPS and umode +g */ @@ -66,7 +67,9 @@ class ModuleNoNickChange : public Module virtual int OnUserPreNick(userrec* user, std::string newnick) { - if (!strcasecmp(user->server,Srv->GetServerName().c_str())) + irc::string server = user->server; + irc::string me = Srv->GetServerName().c_str(); + if (server == me) { for (int i =0; i != MAXCHANS; i++) { diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index e38638cd0..4f851f6a1 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -21,6 +21,7 @@ #include "channels.h" #include "modules.h" #include "helperfuncs.h" +#include "hashcomp.h" /* $ModDesc: Provides support for the /SILENCE command */ @@ -66,7 +67,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); @@ -98,7 +101,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; @@ -156,7 +161,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; } @@ -176,7 +183,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; } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 2eab8b872..c0511838c 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -27,6 +27,7 @@ #include "channels.h" #include "modules.h" #include "helperfuncs.h" +#include "hashcomp.h" Server *Srv; @@ -56,7 +57,11 @@ void handle_tban(char **parameters, int pcnt, userrec *user) } for (timedbans::iterator i = TimedBanList.begin(); i < TimedBanList.end(); i++) { - if ((!strcasecmp(i->mask.c_str(),parameters[2])) && (!strcasecmp(i->channel.c_str(),parameters[0]))) + irc::string listitem = i->mask.c_str(); + irc::string target = parameters[2]; + irc::string listchan = i->channel.c_str(); + irc::string targetchan = parameters[0]; + if ((listitem == target) && (listchan == targetchan)) { Srv->SendServ(user->fd,"NOTICE "+std::string(user->nick)+" :The ban "+std::string(parameters[2])+" is already on the banlist of "+std::string(parameters[0])); return; @@ -113,7 +118,9 @@ class ModuleTimedBans : public Module { for (timedbans::iterator i = TimedBanList.begin(); i < TimedBanList.end(); i++) { - if (!strcasecmp(banmask.c_str(),i->mask.c_str())) + irc::string listitem = banmask.c_str(); + irc::string target = i->mask.c_str(); + if (listitem == target) { TimedBanList.erase(i); break; |