summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-05 21:06:28 +0000
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>2013-06-05 21:06:28 +0000
commit905255a06a3b9a7f4605e28c5b871265eb233642 (patch)
tree9eb5f6e86a4c80121483aa414b615f949a643067
parent45b1cad254498bbf60c9aa6395b1066d19ce579e (diff)
- channel.c: optimized can_join(). Do less intensive tests before actually
testing for ban/exempt masks git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2207 82007160-df01-0410-b94d-b575c5fd34c7
-rw-r--r--src/channel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/channel.c b/src/channel.c
index cd66e39..1c04488 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -641,9 +641,6 @@ is_banned(const struct Channel *chptr, const struct Client *who)
int
can_join(struct Client *source_p, struct Channel *chptr, const char *key)
{
- if (is_banned(chptr, source_p))
- return ERR_BANNEDFROMCHAN;
-
#ifdef HAVE_LIBCRYPTO
if ((chptr->mode.mode & MODE_SSLONLY) && !source_p->localClient->fd.ssl)
return ERR_SSLONLYCHAN;
@@ -670,6 +667,9 @@ can_join(struct Client *source_p, struct Channel *chptr, const char *key)
chptr->mode.limit)
return ERR_CHANNELISFULL;
+ if (is_banned(chptr, source_p))
+ return ERR_BANNEDFROMCHAN;
+
return 0;
}