diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_operchans.cpp | 14 | ||||
-rw-r--r-- | src/modules/m_services_account.cpp | 2 |
2 files changed, 5 insertions, 11 deletions
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; } } |