From 71ad308979d9c9129507fdf85d4305fd12e18bea Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 6 Sep 2006 17:58:59 +0000 Subject: All commands now return results CMD_FAILURE or CMD_SUCCESS git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5150 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/extra/m_ssl_oper_cert.cpp | 10 +++++++++- src/modules/extra/m_sslinfo.cpp | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_ssl_oper_cert.cpp b/src/modules/extra/m_ssl_oper_cert.cpp index 47b4794d3..2d626e77d 100644 --- a/src/modules/extra/m_ssl_oper_cert.cpp +++ b/src/modules/extra/m_ssl_oper_cert.cpp @@ -36,7 +36,7 @@ class cmd_fingerprint : public command_t syntax = ""; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { userrec* target = ServerInstance->FindNick(parameters[0]); if (target) @@ -45,18 +45,26 @@ class cmd_fingerprint : public command_t if (target->GetExt("ssl_cert",cert)) { if (cert->GetFingerprint().length()) + { user->WriteServ("NOTICE %s :Certificate fingerprint for %s is %s",user->nick,target->nick,cert->GetFingerprint().c_str()); + return CMD_SUCCESS; + } else + { user->WriteServ("NOTICE %s :Certificate fingerprint for %s does not exist!", user->nick,target->nick); + return CMD_FAILURE; + } } else { user->WriteServ("NOTICE %s :Certificate fingerprint for %s does not exist!", user->nick, target->nick); + return CMD_FAILURE; } } else { user->WriteServ("401 %s %s :No such nickname", user->nick, parameters[0]); + return CMD_FAILURE; } } }; diff --git a/src/modules/extra/m_sslinfo.cpp b/src/modules/extra/m_sslinfo.cpp index 5a001ce9e..185e9bf0d 100644 --- a/src/modules/extra/m_sslinfo.cpp +++ b/src/modules/extra/m_sslinfo.cpp @@ -36,7 +36,7 @@ class cmd_sslinfo : public command_t this->syntax = ""; } - void Handle (const char** parameters, int pcnt, userrec *user) + CmdResult Handle (const char** parameters, int pcnt, userrec *user) { userrec* target = ServerInstance->FindNick(parameters[0]); ssl_cert* cert; @@ -52,14 +52,18 @@ class cmd_sslinfo : public command_t user->WriteServ("NOTICE %s :*** Distinguised Name: %s", user->nick, cert->GetDN().c_str()); user->WriteServ("NOTICE %s :*** Issuer: %s", user->nick, cert->GetIssuer().c_str()); user->WriteServ("NOTICE %s :*** Key Fingerprint: %s", user->nick, cert->GetFingerprint().c_str()); + return CMD_SUCCESS; } else { user->WriteServ("NOTICE %s :*** No SSL certificate information for this user.", user->nick); + return CMD_FAILURE; } } else user->WriteServ("401 %s %s :No such nickname", user->nick, parameters[0]); + + return CMD_FAILURE; } }; -- cgit v1.2.3