summaryrefslogtreecommitdiff
path: root/src/modules/m_jumpserver.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2013-05-14 16:24:08 -0700
committerAttila Molnar <attilamolnar@hush.com>2013-05-14 16:24:08 -0700
commit23e8bba13c55d33ce89d505780da36c9589e300a (patch)
tree85a2e81cde272a0900b0e448d2d1fabdfd7e897e /src/modules/m_jumpserver.cpp
parentc5ab97b1efe26609e7b9e3ff2301ad0c0911a0f6 (diff)
parent226a95aab09b9e1f43f61e78179bfa1135816c2d (diff)
Merge pull request #523 from SaberUK/master+server-notice
Add method for writing server notices.
Diffstat (limited to 'src/modules/m_jumpserver.cpp')
-rw-r--r--src/modules/m_jumpserver.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp
index b754b2960..30daddc4e 100644
--- a/src/modules/m_jumpserver.cpp
+++ b/src/modules/m_jumpserver.cpp
@@ -53,9 +53,9 @@ class CommandJumpserver : public Command
if (!parameters.size())
{
if (port)
- user->WriteServ("NOTICE %s :*** Disabled jumpserver (previously set to '%s:%d')", user->nick.c_str(), redirect_to.c_str(), port);
+ user->WriteNotice("*** Disabled jumpserver (previously set to '" + redirect_to + ":" + ConvToStr(port) + "')");
else
- user->WriteServ("NOTICE %s :*** Jumpserver was not enabled.", user->nick.c_str());
+ user->WriteNotice("*** Jumpserver was not enabled.");
port = 0;
redirect_to.clear();
@@ -84,7 +84,7 @@ class CommandJumpserver : public Command
redirect_new_users = direction;
break;
default:
- user->WriteServ("NOTICE %s :*** Invalid JUMPSERVER flag: %c", user->nick.c_str(), *n);
+ user->WriteNotice("*** Invalid JUMPSERVER flag: " + ConvToStr(*n));
return CMD_FAILURE;
break;
}
@@ -92,7 +92,7 @@ class CommandJumpserver : public Command
if (!atoi(parameters[1].c_str()))
{
- user->WriteServ("NOTICE %s :*** Invalid port number", user->nick.c_str());
+ user->WriteNotice("*** Invalid port number");
return CMD_FAILURE;
}
@@ -121,13 +121,9 @@ class CommandJumpserver : public Command
port = atoi(parameters[1].c_str());
}
- user->WriteServ("NOTICE %s :*** Set jumpserver to server '%s' port '%s', flags '+%s%s'%s%s%s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[1].c_str(),
- redirect_all_immediately ? "a" : "",
- redirect_new_users ? "n" : "",
- n_done ? " (" : "",
- n_done ? n_done_s.c_str() : "",
- n_done ? " user(s) redirected)" : "",
- reason.c_str());
+ user->WriteNotice("*** Set jumpserver to server '" + parameters[0] + "' port '" + parameters[1] + "', flags '+" +
+ (redirect_all_immediately ? "a" : "") + (redirect_new_users ? "n'" : "'") +
+ (n_done ? " (" + n_done_s + "user(s) redirected): " : ": ") + reason);
}
return CMD_SUCCESS;