From ddb970dd670bcd905c8f34458f8fcf70e9fd89bd Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 19 Feb 2007 08:38:26 +0000 Subject: 1) Fix for nickname overruled with new cullList stuff -- we have to change their nick, its not safe to quit them as it messes up the nick hash. 2) Add a mute flag for users, so we can drop commands from users who have been placed on the cullList. This is independent of the actual cullList and can be used as a general mute flag e.g. by shun modules. 3) Fix /kill to also not quit the user immediately, remove need for CMD_USER_DELETED return anywhere in the code. *** THIS NEEDS TESTING BY QA *** git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6596 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_nick.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/cmd_nick.cpp') diff --git a/src/cmd_nick.cpp b/src/cmd_nick.cpp index ae02a2e6d..03bad2579 100644 --- a/src/cmd_nick.cpp +++ b/src/cmd_nick.cpp @@ -69,17 +69,17 @@ CmdResult cmd_nick::Handle (const char** parameters, int pcnt, userrec *user) if ((ServerInstance->FindNick(parameters[0])) && (ServerInstance->FindNick(parameters[0]) != user) && (ServerInstance->IsNick(parameters[0]))) { userrec* InUse = ServerInstance->FindNick(parameters[0]); - /* XXX FIXME: This no longer works with the global culllist stuff, - * because the user is pushed onto the cullList then we accept a new user - * with the SAME nickname, so this mucks up the nickname hash completely. - * We need to find a way to force a nickchange upon the user whos being - * overruled, rather than quitting them. -- Brain - * if (InUse->registered != REG_ALL) { - userrec::QuitUser(ServerInstance, InUse, "Nickname overruled"); + /* change the nick of the older user to nnn-overruled, + * where nnn is their file descriptor. We know this to be unique. + */ + std::string changeback = ConvToStr(InUse->fd) + "-overruled"; + InUse->UpdateNickHash(changeback.c_str()); + strlcpy(InUse->nick, changeback.c_str(), NICKMAX - 1); + InUse->InvalidateCache(); } - else*/ + else { user->WriteServ("433 %s %s :Nickname is already in use.", user->registered >= REG_NICK ? user->nick : "*", parameters[0]); return CMD_FAILURE; -- cgit v1.3.1-10-gc9f91