diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:52:21 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-09-02 00:52:21 +0000 |
commit | 68174076d7d665340ca992f88013dc2e6035a0a8 (patch) | |
tree | 6dbc69a7c6d82321686c1ea45a96784526e6a693 | |
parent | cdf850dcbbd3153bceaed15ee2d3b42f568c9bf3 (diff) |
Route CHGHOST/CHGNAME/CHGIDENT using optional unicast routing
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11653 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/m_chghost.cpp | 13 | ||||
-rw-r--r-- | src/modules/m_chgident.cpp | 20 | ||||
-rw-r--r-- | src/modules/m_chgname.cpp | 11 |
3 files changed, 32 insertions, 12 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index a8cad8d43..0d509b7d9 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -66,14 +66,17 @@ class CommandChghost : public Command // fix by brain - ulines set hosts silently ServerInstance->SNO->WriteGlobalSno('a', std::string(user->nick)+" used CHGHOST to make the displayed host of "+dest->nick+" become "+dest->dhost); } - - /* ChangeDisplayedHost fixes it for us */ - return CMD_LOCALONLY; } - /* route it! */ return CMD_SUCCESS; + } + RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) + { + User* dest = ServerInstance->FindNick(parameters[0]); + if (dest) + return ROUTE_OPT_UCAST(dest->server); + return ROUTE_LOCALONLY; } }; @@ -112,7 +115,7 @@ class ModuleChgHost : public Module Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_OPTCOMMON | VF_VENDOR, API_VERSION); } }; diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 58a06cbd8..d52691054 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -54,14 +54,24 @@ class CommandChgident : public Command return CMD_FAILURE; } - dest->ChangeIdent(parameters[1].c_str()); + if (IS_LOCAL(dest)) + { + dest->ChangeIdent(parameters[1].c_str()); - if (!ServerInstance->ULine(user->server)) - ServerInstance->SNO->WriteToSnoMask(IS_LOCAL(dest) ? 'a' : 'A', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str()); + if (!ServerInstance->ULine(user->server)) + ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGIDENT to change %s's ident to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->ident.c_str()); + } - /* route it! */ return CMD_SUCCESS; } + + RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) + { + User* dest = ServerInstance->FindNick(parameters[0]); + if (dest) + return ROUTE_OPT_UCAST(dest->server); + return ROUTE_LOCALONLY; + } }; @@ -81,7 +91,7 @@ public: virtual Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_OPTCOMMON | VF_VENDOR, API_VERSION); } }; diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp index 23c870294..0f9302a76 100644 --- a/src/modules/m_chgname.cpp +++ b/src/modules/m_chgname.cpp @@ -54,9 +54,16 @@ class CommandChgname : public Command ServerInstance->SNO->WriteGlobalSno('a', "%s used CHGNAME to change %s's real name to '%s'", user->nick.c_str(), dest->nick.c_str(), dest->fullname.c_str()); } - /* route it! */ return CMD_SUCCESS; } + + RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters) + { + User* dest = ServerInstance->FindNick(parameters[0]); + if (dest) + return ROUTE_OPT_UCAST(dest->server); + return ROUTE_LOCALONLY; + } }; @@ -76,7 +83,7 @@ public: virtual Version GetVersion() { - return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION); + return Version("$Id$", VF_OPTCOMMON | VF_VENDOR, API_VERSION); } }; |