summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-03-29 12:54:02 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-03-29 12:54:02 +0200
commit4aed5846f17b15939aaf620ee4c4ca95a10609fc (patch)
tree2ef9b2e003acc6a2b695b0ee1aefda0870ea0c0c
parentda2b0ee6cad139804442a1ebcd0448755714f22a (diff)
Simplify GetRouting() methods doing unicast
-rw-r--r--src/modules/m_chghost.cpp5
-rw-r--r--src/modules/m_chgident.cpp5
-rw-r--r--src/modules/m_chgname.cpp5
-rw-r--r--src/modules/m_nicklock.cpp10
-rw-r--r--src/modules/m_sajoin.cpp5
-rw-r--r--src/modules/m_sakick.cpp5
-rw-r--r--src/modules/m_sanick.cpp5
-rw-r--r--src/modules/m_sapart.cpp5
-rw-r--r--src/modules/m_saquit.cpp5
-rw-r--r--src/modules/m_silence.cpp5
-rw-r--r--src/modules/m_spanningtree/svsjoin.cpp5
-rw-r--r--src/modules/m_spanningtree/svsnick.cpp5
-rw-r--r--src/modules/m_spanningtree/svspart.cpp5
-rw-r--r--src/modules/m_uninvite.cpp3
14 files changed, 15 insertions, 58 deletions
diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp
index 163f1f2eb..60146c78b 100644
--- a/src/modules/m_chghost.cpp
+++ b/src/modules/m_chghost.cpp
@@ -77,10 +77,7 @@ class CommandChghost : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp
index 0b4e78f12..8ba5b4a5b 100644
--- a/src/modules/m_chgident.cpp
+++ b/src/modules/m_chgident.cpp
@@ -70,10 +70,7 @@ class CommandChgident : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_chgname.cpp b/src/modules/m_chgname.cpp
index 3ad9cede9..2582ef652 100644
--- a/src/modules/m_chgname.cpp
+++ b/src/modules/m_chgname.cpp
@@ -66,10 +66,7 @@ class CommandChgname : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp
index a517e95ac..35845c8d8 100644
--- a/src/modules/m_nicklock.cpp
+++ b/src/modules/m_nicklock.cpp
@@ -78,10 +78,7 @@ class CommandNicklock : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
@@ -128,10 +125,7 @@ class CommandNickunlock : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp
index cc97c7308..9d87360ec 100644
--- a/src/modules/m_sajoin.cpp
+++ b/src/modules/m_sajoin.cpp
@@ -103,10 +103,7 @@ class CommandSajoin : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_sakick.cpp b/src/modules/m_sakick.cpp
index 8fc6e741b..ab168ca68 100644
--- a/src/modules/m_sakick.cpp
+++ b/src/modules/m_sakick.cpp
@@ -75,10 +75,7 @@ class CommandSakick : public Command
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
- User* dest = ServerInstance->FindNick(parameters[1]);
- if (dest)
- return ROUTE_OPT_UCAST(dest->server);
- return ROUTE_LOCALONLY;
+ return ROUTE_OPT_UCAST(parameters[1]);
}
};
diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp
index fd9a825dd..3dc89b4f6 100644
--- a/src/modules/m_sanick.cpp
+++ b/src/modules/m_sanick.cpp
@@ -79,10 +79,7 @@ class CommandSanick : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp
index 65c32cd8a..db1e6fdee 100644
--- a/src/modules/m_sapart.cpp
+++ b/src/modules/m_sapart.cpp
@@ -80,10 +80,7 @@ class CommandSapart : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp
index 4d5ac6e22..c3895ec12 100644
--- a/src/modules/m_saquit.cpp
+++ b/src/modules/m_saquit.cpp
@@ -61,10 +61,7 @@ class CommandSaquit : public Command
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;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp
index 7d3b3f90c..0ec40a92f 100644
--- a/src/modules/m_silence.cpp
+++ b/src/modules/m_silence.cpp
@@ -93,10 +93,7 @@ class CommandSVSSilence : public Command
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
- User* target = ServerInstance->FindNick(parameters[0]);
- if (target)
- return ROUTE_OPT_UCAST(target->server);
- return ROUTE_LOCALONLY;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};
diff --git a/src/modules/m_spanningtree/svsjoin.cpp b/src/modules/m_spanningtree/svsjoin.cpp
index 98443409a..c85e4f412 100644
--- a/src/modules/m_spanningtree/svsjoin.cpp
+++ b/src/modules/m_spanningtree/svsjoin.cpp
@@ -54,8 +54,5 @@ CmdResult CommandSVSJoin::Handle(User* user, std::vector<std::string>& parameter
RouteDescriptor CommandSVSJoin::GetRouting(User* user, const std::vector<std::string>& parameters)
{
- User* u = ServerInstance->FindUUID(parameters[0]);
- if (u)
- return ROUTE_OPT_UCAST(u->server);
- return ROUTE_LOCALONLY;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
diff --git a/src/modules/m_spanningtree/svsnick.cpp b/src/modules/m_spanningtree/svsnick.cpp
index b3a612ca3..84cf8558c 100644
--- a/src/modules/m_spanningtree/svsnick.cpp
+++ b/src/modules/m_spanningtree/svsnick.cpp
@@ -72,8 +72,5 @@ CmdResult CommandSVSNick::Handle(User* user, std::vector<std::string>& parameter
RouteDescriptor CommandSVSNick::GetRouting(User* user, const std::vector<std::string>& parameters)
{
- User* u = ServerInstance->FindNick(parameters[0]);
- if (u)
- return ROUTE_OPT_UCAST(u->server);
- return ROUTE_LOCALONLY;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
diff --git a/src/modules/m_spanningtree/svspart.cpp b/src/modules/m_spanningtree/svspart.cpp
index f86afa367..c4163ef3d 100644
--- a/src/modules/m_spanningtree/svspart.cpp
+++ b/src/modules/m_spanningtree/svspart.cpp
@@ -42,8 +42,5 @@ CmdResult CommandSVSPart::Handle(User* user, std::vector<std::string>& parameter
RouteDescriptor CommandSVSPart::GetRouting(User* user, const std::vector<std::string>& parameters)
{
- User* u = ServerInstance->FindUUID(parameters[0]);
- if (u)
- return ROUTE_OPT_UCAST(u->server);
- return ROUTE_LOCALONLY;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp
index 19184751d..d3a424dff 100644
--- a/src/modules/m_uninvite.cpp
+++ b/src/modules/m_uninvite.cpp
@@ -105,8 +105,7 @@ class CommandUninvite : public Command
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
- User* u = ServerInstance->FindNick(parameters[0]);
- return u ? ROUTE_OPT_UCAST(u->server) : ROUTE_LOCALONLY;
+ return ROUTE_OPT_UCAST(parameters[0]);
}
};