X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fnumeric.h;h=3e24c8a82898522f1baa752b8eb7fbd85cead10c;hb=c05f81cac83e80c7727594e3929e0709eccca689;hp=e7438b53a326c65b822c896b1d2b1fdf2d895c2a;hpb=28dcc1f9e017152f03b0d9bfbcc494260b015a0a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/numeric.h b/include/numeric.h index e7438b53a..3e24c8a82 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -1,6 +1,7 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2018 Sadie Powell * Copyright (C) 2016 Attila Molnar * * This file is part of InspIRCd. InspIRCd is free software: you can @@ -34,7 +35,11 @@ class Numeric::Numeric /** Parameters of the numeric */ - std::vector params; + CommandBase::Params params; + + /** Source server of the numeric, if NULL (the default) then it is the local server + */ + Server* sourceserver; public: /** Constructor @@ -42,6 +47,7 @@ class Numeric::Numeric */ Numeric(unsigned int num) : numeric(num) + , sourceserver(NULL) { } @@ -55,6 +61,16 @@ class Numeric::Numeric return *this; } + /** Set the source server of the numeric. The source server defaults to the local server. + * @param server Server to set as source + */ + void SetServer(Server* server) { sourceserver = server; } + + /** Get the source server of the numeric + * @return Source server or NULL if the source is the local server + */ + Server* GetServer() const { return sourceserver; } + /** Get the number of the numeric as an unsigned integer * @return Numeric number as an unsigned integer */ @@ -63,26 +79,10 @@ class Numeric::Numeric /** Get the parameters of the numeric * @return Parameters of the numeric as a const vector of strings */ - const std::vector& GetParams() const { return params; } + const CommandBase::Params& GetParams() const { return params; } /** Get the parameters of the numeric * @return Parameters of the numeric as a vector of strings */ - std::vector& GetParams() { return params; } + CommandBase::Params& GetParams() { return params; } }; - -namespace Numerics -{ - /** ERR_NOSUCHNICK numeric - */ - class NoSuchNick : public Numeric::Numeric - { - public: - NoSuchNick(const std::string& nick) - : Numeric(ERR_NOSUCHNICK) - { - push(nick); - push("No such nick/channel"); - } - }; -}