summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-08 16:38:30 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-05-08 16:38:30 +0000
commitd0646a9b10ee279c8932542657fb320b39face65 (patch)
treefc706e1918dc129d6ba975c855422153a0d8dea5 /src/modules
parent911676479377723f9672e2ed0e2b03e15412f2df (diff)
Remove a level of nesting from this
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9662 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_banexception.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp
index 609e5c221..c39a74164 100644
--- a/src/modules/m_banexception.cpp
+++ b/src/modules/m_banexception.cpp
@@ -69,19 +69,21 @@ public:
if (list)
{
- char mask[MAXBUF];
- snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
- for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ // No list, so let them in anyway.
+ return 0;
+ }
+
+ char mask[MAXBUF];
+ snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
+
+ for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ {
+ if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
{
- if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
- {
- // They match an entry on the list, so let them in.
- return 1;
- }
+ // They match an entry on the list, so let them in.
+ return 1;
}
- return 0;
}
- // or if there wasn't a list, there can't be anyone on it, so we don't need to do anything.
}
return 0;
}