From 4f819960854d4e89c958b0ebacfcea692e152e09 Mon Sep 17 00:00:00 2001 From: w00t Date: Fri, 11 May 2007 18:07:18 +0000 Subject: Logic cleanup here too. git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6976 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_chghost.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index d4047ad48..45eaaa378 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -52,17 +52,22 @@ class cmd_chghost : public command_t return CMD_FAILURE; } userrec* dest = ServerInstance->FindNick(parameters[0]); - if (dest) + + if (!dest) { - if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) - { - // fix by brain - ulines set hosts silently - ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); - } - return CMD_SUCCESS; + /* Drop it like a hot potato. XXX - we should probably message here.. -- w00t */ + return CMD_FAILURE; } - return CMD_FAILURE; + if ((dest->ChangeDisplayedHost(parameters[1])) && (!ServerInstance->ULine(user->server))) + { + // fix by brain - ulines set hosts silently + ServerInstance->WriteOpers(std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); + } + + /* route it! */ + return CMD_SUCCESS; + } }; -- cgit v1.2.3