aboutsummaryrefslogtreecommitdiffstats
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorGravatar Daniel De Graaf2010-08-04 14:09:06 -0400
committerGravatar Daniel De Graaf2010-08-04 14:09:06 -0400
commit51d958eb07fa1cd70ee281e890b8320db20a1390 (patch)
tree157ea9e856dc10d1194d7363317ea6a3d1d1bce0 /src/channels.cpp
parentSet target user for a join to the joining user (diff)
Send error message to users on failed join
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp8
1 files changed, 8 insertions, 0 deletions
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');