Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "module.h"
00015
00016 class CommandNSSASetNoexpire : public Command
00017 {
00018 public:
00019 CommandNSSASetNoexpire(Module *creator) : Command(creator, "nickserv/saset/noexpire", 1, 2)
00020 {
00021 this->SetDesc(_("Prevent the nickname from expiring"));
00022 this->SetSyntax(_("\037nickname\037 {ON | OFF}"));
00023 }
00024
00025 void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override
00026 {
00027 NickAlias *na = NickAlias::Find(params[0]);
00028 if (na == NULL)
00029 {
00030 source.Reply(NICK_X_NOT_REGISTERED, params[0].c_str());
00031 return;
00032 }
00033
00034 Anope::string param = params.size() > 1 ? params[1] : "";
00035
00036 if (param.equals_ci("ON"))
00037 {
00038 na->SetFlag(NS_NO_EXPIRE);
00039 source.Reply(_("Nick %s \002will not\002 expire."), na->nick.c_str());
00040 }
00041 else if (param.equals_ci("OFF"))
00042 {
00043 na->UnsetFlag(NS_NO_EXPIRE);
00044 source.Reply(_("Nick %s \002will\002 expire."), na->nick.c_str());
00045 }
00046 else
00047 this->OnSyntaxError(source, "NOEXPIRE");
00048
00049 return;
00050 }
00051
00052 bool OnHelp(CommandSource &source, const Anope::string &) anope_override
00053 {
00054 this->SendSyntax(source);
00055 source.Reply(" ");
00056 source.Reply(_("Sets whether the given nickname will expire. Setting this\n"
00057 "to \002ON\002 prevents the nickname from expiring."));
00058 return true;
00059 }
00060 };
00061
00062 class NSSASetNoexpire : public Module
00063 {
00064 CommandNSSASetNoexpire commandnssasetnoexpire;
00065
00066 public:
00067 NSSASetNoexpire(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
00068 commandnssasetnoexpire(this)
00069 {
00070 this->SetAuthor("Anope");
00071
00072 }
00073 };
00074
00075 MODULE_INIT(NSSASetNoexpire)