From 27cef863f7286b626e01f1287f31005478a66fea Mon Sep 17 00:00:00 2001 From: w00t Date: Tue, 5 Aug 2008 15:05:38 +0000 Subject: Missed another git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10096 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_operchans.cpp | 14 ++++---------- src/modules/m_services_account.cpp | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 7bc132515..118349b06 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -63,15 +63,14 @@ class ModuleOperChans : public Module virtual int OnUserPreJoin(User* user, Channel* chan, const char* cname, std::string &privs, const std::string &keygiven) { - bool banned = false; - if (!IS_OPER(user)) { if (chan) { if (chan->IsModeSet('O')) { - banned = true; + user->WriteNumeric(ERR_CANTJOINOPERSONLY, "%s %s :Only IRC operators may join the channel %s (+O is set)",user->nick.c_str(), chan->name.c_str(), chan->name.c_str()); + return 1; } } } @@ -79,16 +78,11 @@ class ModuleOperChans : public Module { if (chan && chan->IsExtBanned(user->oper, 'O')) { - banned = true; + user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Cannot join channel (You're banned)", user->nick.c_str(), c->name.c_str()); + return 1; } } - if (banned) - { - user->WriteNumeric(ERR_CANTJOINOPERSONLY, "%s %s :Only IRC operators may join the channel %s (+O is set)",user->nick.c_str(), chan->name.c_str(), chan->name.c_str()); - return 1; - } - return 0; } diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 0b842ce7c..76712df61 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -164,7 +164,7 @@ class ModuleServicesAccount : public Module if (chan->IsExtBanned(*account, 'R')) { // may not join - user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Cannot join channel (You're banned)", user->nick.c_str(), c->name.c_str()); + user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s %s :Cannot join channel (You're banned)", user->nick.c_str(), chan->name.c_str()); return 1; } } -- cgit v1.2.3