From 51d958eb07fa1cd70ee281e890b8320db20a1390 Mon Sep 17 00:00:00 2001 From: Daniel De Graaf Date: Wed, 4 Aug 2010 14:09:06 -0400 Subject: Send error message to users on failed join --- src/channels.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 51ab99162..fa70d3a05 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -258,7 +258,11 @@ Channel* Channel::JoinUser(User *user, const std::string& cn, bool override, con FOR_EACH_MOD(OnCheckJoin, (perm)); FOR_EACH_MOD(OnPermissionCheck, (perm)); if (perm.result == MOD_RES_DENY) + { + if (!perm.reason.empty()) + user->SendText(perm.reason); return NULL; + } } Ptr = new Channel(cn, TS); @@ -277,7 +281,11 @@ Channel* Channel::JoinUser(User *user, const std::string& cn, bool override, con { FOR_EACH_MOD(OnCheckJoin, (perm)); if (perm.result == MOD_RES_DENY) + { + if (!perm.reason.empty()) + user->SendText(perm.reason); return NULL; + } if (perm.result == MOD_RES_PASSTHRU) { std::string ckey = Ptr->GetModeParameter('k'); -- cgit v1.3.1-10-gc9f91