summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp30
-rw-r--r--src/modules/m_spanningtree/main.cpp4
2 files changed, 32 insertions, 2 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 9cef16ef4..4bc09b3f4 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -597,6 +597,8 @@ void CommandParser::SetupCommandTable(userrec* user)
int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, std::string &dest)
{
userrec* user = NULL;
+ std::string item;
+
switch (to)
{
case TR_NICK:
@@ -608,10 +610,38 @@ int CommandParser::TranslateUIDs(TranslateType to, const std::string &source, st
dest = source;
break;
case TR_NICKLIST:
+ {
/* Translate comma seperated list of nicknames */
+ irc::commasepstream items(source);
+ while (items.GetToken(item))
+ {
+ user = ServerInstance->FindNick(item);
+ if (user)
+ dest.append(user->uuid);
+ else
+ dest.append(source);
+ dest.append(",");
+ }
+ if (!dest.empty())
+ dest.erase(dest.end() - 1);
+ }
break;
case TR_SPACENICKLIST:
+ {
/* Translate space seperated list of nicknames */
+ irc::spacesepstream items(source);
+ while (items.GetToken(item))
+ {
+ user = ServerInstance->FindNick(item);
+ if (user)
+ dest.append(user->uuid);
+ else
+ dest.append(source);
+ dest.append(" ");
+ }
+ if (!dest.empty())
+ dest.erase(dest.end() - 1);
+ }
break;
case TR_END:
case TR_TEXT:
diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp
index 651afe095..c180bfd0c 100644
--- a/src/modules/m_spanningtree/main.cpp
+++ b/src/modules/m_spanningtree/main.cpp
@@ -812,8 +812,8 @@ void ModuleSpanningTree::OnPostCommand(const std::string &command, const char**
// commands and linking protocols.
std::deque<std::string> params;
params.clear();
- size_t n_translate = thiscmd->translation.size();
- TranslationType translate_to;
+ int n_translate = thiscmd->translation.size();
+ TranslateType translate_to;
for (int j = 0; j < pcnt; j++)
{