summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-19 13:51:23 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-09-19 13:51:23 +0000
commit34e8e5ff50213baad0ac81df8261a736d96e9b2d (patch)
treee38767787bc20d4665568616c9fa27acc3075532 /src
parent89dc9ab19899e8bde4761da2e3f86194cf34fc21 (diff)
Tidy up key handling
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5301 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 226fb5af2..4c5965759 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -260,21 +260,11 @@ chanrec* chanrec::JoinUser(InspIRCd* Instance, userrec *user, const char* cn, bo
FOREACH_RESULT_I(Instance,I_OnCheckKey,OnCheckKey(user, Ptr, key ? key : ""));
if (!MOD_RESULT)
{
- if (!key)
+ if ((!key) || strcmp(key,Ptr->key))
{
- Instance->Log(DEBUG,"chanrec::JoinUser(): no key given in JOIN");
- user->WriteServ("475 %s %s :Cannot join channel (Requires key)",user->nick, Ptr->name);
+ user->WriteServ("475 %s %s :Cannot join channel (Incorrect channel key)",user->nick, Ptr->name);
return NULL;
}
- else
- {
- if (strcmp(key,Ptr->key))
- {
- Instance->Log(DEBUG,"chanrec::JoinUser(): bad key given in JOIN");
- user->WriteServ("475 %s %s :Cannot join channel (Incorrect key)",user->nick, Ptr->name);
- return NULL;
- }
- }
}
}
if (Ptr->modes[CM_INVITEONLY])