summaryrefslogtreecommitdiff
path: root/src/modules/m_sslinfo.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-04-28 12:17:53 +0100
committerPeter Powell <petpow@saberuk.com>2013-05-14 23:30:12 +0100
commit226a95aab09b9e1f43f61e78179bfa1135816c2d (patch)
tree373f6d34cbfbea9e392cb4ab6515aca3a54a6e7e /src/modules/m_sslinfo.cpp
parentb89aa87280767f47381b8a612f73f1d0fe682e2e (diff)
Add method for writing server notices.
This allows us to send a server notice to a user without worrying about whether they are registered or not. If a user receives a server notice and they are not registered then the nickname field will contain an asterisk instead of their nick name.
Diffstat (limited to 'src/modules/m_sslinfo.cpp')
-rw-r--r--src/modules/m_sslinfo.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index b51c30b76..7c8cc12f2 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -99,23 +99,23 @@ class CommandSSLInfo : public Command
bool operonlyfp = ServerInstance->Config->ConfValue("sslinfo")->getBool("operonly");
if (operonlyfp && !user->IsOper() && target != user)
{
- user->WriteServ("NOTICE %s :*** You cannot view SSL certificate information for other users", user->nick.c_str());
+ user->WriteNotice("*** You cannot view SSL certificate information for other users");
return CMD_FAILURE;
}
ssl_cert* cert = CertExt.get(target);
if (!cert)
{
- user->WriteServ("NOTICE %s :*** No SSL certificate for this user", user->nick.c_str());
+ user->WriteNotice("*** No SSL certificate for this user");
}
else if (cert->GetError().length())
{
- user->WriteServ("NOTICE %s :*** No SSL certificate information for this user (%s).", user->nick.c_str(), cert->GetError().c_str());
+ user->WriteNotice("*** No SSL certificate information for this user (" + cert->GetError() + ").");
}
else
{
- user->WriteServ("NOTICE %s :*** Distinguished Name: %s", user->nick.c_str(), cert->GetDN().c_str());
- user->WriteServ("NOTICE %s :*** Issuer: %s", user->nick.c_str(), cert->GetIssuer().c_str());
- user->WriteServ("NOTICE %s :*** Key Fingerprint: %s", user->nick.c_str(), cert->GetFingerprint().c_str());
+ user->WriteNotice("*** Distinguished Name: " + cert->GetDN());
+ user->WriteNotice("*** Issuer: " + cert->GetIssuer());
+ user->WriteNotice("*** Key Fingerprint: " + cert->GetFingerprint());
}
return CMD_SUCCESS;
}