diff options
| author | 2006-09-19 13:51:23 +0000 | |
|---|---|---|
| committer | 2006-09-19 13:51:23 +0000 | |
| commit | 34e8e5ff50213baad0ac81df8261a736d96e9b2d (patch) | |
| tree | e38767787bc20d4665568616c9fa27acc3075532 /src/channels.cpp | |
| parent | Make xline more memory-efficient and faster/neater. Eliminate a mass of fixed... (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/channels.cpp')
| -rw-r--r-- | src/channels.cpp | 14 |
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]) |
