From bee8625fbe375f55053d3709b72a2972fbf6ba84 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Thu, 3 Jul 2014 12:21:00 +0200 Subject: Move calling the OnUserPreNick() hook and the restrictbannedusers check from core to cmd_nick (core_user) --- src/users.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/users.cpp') diff --git a/src/users.cpp b/src/users.cpp index 75852330f..47dbd2d22 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -619,32 +619,6 @@ bool User::ChangeNick(const std::string& newnick, bool force, time_t newts) return false; } - LocalUser* const localuser = IS_LOCAL(this); - if (!force && localuser) - { - ModResult MOD_RESULT; - FIRST_MOD_RESULT(OnUserPreNick, MOD_RESULT, (localuser, newnick)); - - // If a module denied the change, abort now - if (MOD_RESULT == MOD_RES_DENY) - return false; - - // Disallow the nick change if is on and there is a ban matching this user in - // one of the channels they are on - if (ServerInstance->Config->RestrictBannedUsers) - { - for (UCListIter i = this->chans.begin(); i != this->chans.end(); ++i) - { - Channel* chan = (*i)->chan; - if (chan->GetPrefixValue(this) < VOICE_VALUE && chan->IsBanned(this)) - { - this->WriteNumeric(ERR_CANNOTSENDTOCHAN, "%s :Cannot send to channel (you're banned)", chan->name.c_str()); - return false; - } - } - } - } - if (assign(newnick) == assign(nick)) { // case change, don't need to check campers -- cgit v1.3.1-10-gc9f91