]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_starttls.cpp
Add support for blocking tag messages with the deaf mode.
[user/henk/code/inspircd.git] / src / modules / m_starttls.cpp
index b05302fa96c93f83197e4e547e6e67d79c04004a..80e2bb006060b69a020aaa5e1b75531ed03d889e 100644 (file)
@@ -1,7 +1,11 @@
 /*
  * InspIRCd -- Internet Relay Chat Daemon
  *
+ *   Copyright (C) 2020 Matt Schatz <genius3000@g3k.solutions>
+ *   Copyright (C) 2019 Robby <robby@chatbelgie.be>
+ *   Copyright (C) 2018 Sadie Powell <sadie@witchery.services>
  *   Copyright (C) 2014 Adam <Adam@anope.org>
+ *   Copyright (C) 2013, 2015-2016 Attila Molnar <attilamolnar@hush.com>
  *
  * This file is part of InspIRCd.  InspIRCd is free software: you can
  * redistribute it and/or modify it under the terms of the GNU General Public
@@ -40,29 +44,29 @@ class CommandStartTLS : public SplitCommand
                works_before_reg = true;
        }
 
-       CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
+       CmdResult HandleLocal(LocalUser* user, const Params& parameters) CXX11_OVERRIDE
        {
                if (!ssl)
                {
-                       user->WriteNumeric(ERR_STARTTLS, ":STARTTLS is not enabled");
+                       user->WriteNumeric(ERR_STARTTLS, "STARTTLS is not enabled");
                        return CMD_FAILURE;
                }
 
                if (user->registered == REG_ALL)
                {
-                       user->WriteNumeric(ERR_STARTTLS, ":STARTTLS is not permitted after client registration is complete");
+                       user->WriteNumeric(ERR_STARTTLS, "STARTTLS is not permitted after client registration is complete");
                        return CMD_FAILURE;
                }
 
                if (user->eh.GetIOHook())
                {
-                       user->WriteNumeric(ERR_STARTTLS, ":STARTTLS failure");
+                       user->WriteNumeric(ERR_STARTTLS, "STARTTLS failure");
                        return CMD_FAILURE;
                }
 
-               user->WriteNumeric(RPL_STARTTLS, ":STARTTLS successful, go ahead with TLS handshake");
+               user->WriteNumeric(RPL_STARTTLS, "STARTTLS successful, go ahead with TLS handshake");
                /* We need to flush the write buffer prior to adding the IOHook,
-                * otherwise we'll be sending this line inside the SSL session - which
+                * otherwise we'll be sending this line inside the TLS (SSL) session - which
                 * won't start its handshake until the client gets this line. Currently,
                 * we assume the write will not block here; this is usually safe, as
                 * STARTTLS is sent very early on in the registration phase, where the
@@ -80,7 +84,7 @@ class CommandStartTLS : public SplitCommand
 class ModuleStartTLS : public Module
 {
        CommandStartTLS starttls;
-       GenericCap tls;
+       Cap::Capability tls;
        dynamic_reference_nocheck<IOHookProvider> ssl;
 
  public:
@@ -102,14 +106,9 @@ class ModuleStartTLS : public Module
                        ssl.SetProvider("ssl/" + newprovider);
        }
 
-       void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
-       {
-               tokens["STARTTLS"];
-       }
-
        Version GetVersion() CXX11_OVERRIDE
        {
-               return Version("Provides support for the STARTTLS command", VF_VENDOR);
+               return Version("Provides the IRCv3 tls client capability.", VF_VENDOR);
        }
 };