summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-15 02:39:11 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-15 02:39:11 +0000
commit3385d43be8fbac15a16f00777f5c6eba01908373 (patch)
tree85cf364c3cbcbd1a94c98dfe979f1fd57cc3a055
parent56aea01ab7e6d4ab2ac904615a5d5c4a376bb2d6 (diff)
- Let's stop using that nasty strchr() in a loop
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3204 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_denychans.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp
index 4ea2e3d85..709a285a0 100644
--- a/src/modules/m_denychans.cpp
+++ b/src/modules/m_denychans.cpp
@@ -59,13 +59,15 @@ class ModuleDenyChannels : public Module
virtual int OnUserPreJoin(userrec* user, chanrec* chan, const char* cname)
{
+ bool isoper = strchr(user->modes,'o') ? true : false;
+
for (int j =0; j < Conf->Enumerate("badchan"); j++)
{
irc::string cn = Conf->ReadValue("badchan","name",j).c_str();
irc::string thischan = cname;
if (thischan == cn)
{
- if ((Conf->ReadFlag("badchan","allowopers",j)) && (strchr(user->modes,'o')))
+ if ((Conf->ReadFlag("badchan","allowopers",j)) && isoper == true)
{
return 0;
}