diff options
| author | Adam <Adam@anope.org> | 2010-07-10 19:08:16 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-07-10 19:08:16 -0400 |
| commit | 4b1e76c3bb7baa5ece83779889a46420ded3e495 (patch) | |
| tree | 442b8e34d30641f1b6d455bb0eb10d3240b7f344 /src/core | |
| parent | 166d6f5d0933a3c639b869235f0fabdfac499886 (diff) | |
Added ns_set_misc and cs_set_misc.
These modules allows users to configure settable options in /ns and /cs set
that will be displayed in /ns and /cs info.
Removed os_info, cs_set_url, ns_set_url, cs_set_email, ns_set_icq
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/cs_info.cpp | 4 | ||||
| -rw-r--r-- | src/core/cs_set_email.cpp | 103 | ||||
| -rw-r--r-- | src/core/cs_set_entrymsg.cpp | 2 | ||||
| -rw-r--r-- | src/core/cs_set_url.cpp | 111 | ||||
| -rw-r--r-- | src/core/db_plain.cpp | 16 | ||||
| -rw-r--r-- | src/core/ns_group.cpp | 3 | ||||
| -rw-r--r-- | src/core/ns_info.cpp | 4 | ||||
| -rw-r--r-- | src/core/ns_set_icq.cpp | 133 | ||||
| -rw-r--r-- | src/core/ns_set_url.cpp | 125 |
9 files changed, 1 insertions, 500 deletions
diff --git a/src/core/cs_info.cpp b/src/core/cs_info.cpp index 924df4ed5..9b70735dd 100644 --- a/src/core/cs_info.cpp +++ b/src/core/cs_info.cpp @@ -82,10 +82,6 @@ class CommandCSInfo : public Command if (ci->entry_message && show_all) notice_lang(Config.s_ChanServ, u, CHAN_INFO_ENTRYMSG, ci->entry_message); - if (ci->url) - notice_lang(Config.s_ChanServ, u, CHAN_INFO_URL, ci->url); - if (ci->email) - notice_lang(Config.s_ChanServ, u, CHAN_INFO_EMAIL, ci->email); if (show_all) { diff --git a/src/core/cs_set_email.cpp b/src/core/cs_set_email.cpp deleted file mode 100644 index 61bd4ee76..000000000 --- a/src/core/cs_set_email.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* ChanServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandCSSetEMail : public Command -{ - public: - CommandCSSetEMail(const ci::string &cname, const ci::string &cpermission = "") : Command(cname, 1, 2, cpermission) - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - ChannelInfo *ci = cs_findchan(params[0]); - assert(ci); - - if (ci->email) - delete [] ci->email; - if (params.size() > 1) - { - ci->email = sstrdup(params[1].c_str()); - notice_lang(Config.s_ChanServ, u, CHAN_EMAIL_CHANGED, ci->name.c_str(), ci->email); - } - else - { - ci->email = NULL; - notice_lang(Config.s_ChanServ, u, CHAN_EMAIL_UNSET, ci->name.c_str()); - } - - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_EMAIL, "SET"); - return true; - } - - void OnSyntaxError(User *u, const ci::string &) - { - // XXX - syntax_error(Config.s_ChanServ, u, "SET", CHAN_SET_SYNTAX); - } - - void OnServHelp(User *u) - { - notice_lang(Config.s_ChanServ, u, CHAN_HELP_CMD_SET_EMAIL); - } -}; - -class CommandCSSASetEMail : public CommandCSSetEMail -{ - public: - CommandCSSASetEMail(const ci::string &cname) : CommandCSSetEMail(cname, "chanserv/saset/email") - { - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_EMAIL, "SASET"); - return true; - } - - void OnSyntaxError(User *u, const ci::string &) - { - /// XXX - syntax_error(Config.s_ChanServ, u, "SASET", CHAN_SASET_SYNTAX); - } -}; - -class CSSetEMail : public Module -{ - public: - CSSetEMail(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - Command *c = FindCommand(ChanServ, "SET"); - if (c) - c->AddSubcommand(new CommandCSSetEMail("EMAIL")); - } - - ~CSSetEMail() - { - Command *c = FindCommand(ChanServ, "SET"); - if (c) - c->DelSubcommand("EMAIL"); - } -}; - -MODULE_INIT(CSSetEMail) diff --git a/src/core/cs_set_entrymsg.cpp b/src/core/cs_set_entrymsg.cpp index cddcff36b..d2ec2bccc 100644 --- a/src/core/cs_set_entrymsg.cpp +++ b/src/core/cs_set_entrymsg.cpp @@ -43,7 +43,7 @@ class CommandCSSetEntryMsg : public Command bool OnHelp(User *u, const ci::string &) { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_ENTRYMSG, "SEt"); + notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_ENTRYMSG, "SET"); return true; } diff --git a/src/core/cs_set_url.cpp b/src/core/cs_set_url.cpp deleted file mode 100644 index 878cc9562..000000000 --- a/src/core/cs_set_url.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* ChanServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandCSSetURL : public Command -{ - public: - CommandCSSetURL(const ci::string &cname, const ci::string &cpermission = "") : Command(cname, 1, 2, cpermission) - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - ChannelInfo *ci = cs_findchan(params[0]); - assert(ci); - - if (ci->url) - delete [] ci->url; - if (params.size() > 1) - { - ci->url = sstrdup(params[1].c_str()); - notice_lang(Config.s_ChanServ, u, CHAN_URL_CHANGED, ci->name.c_str(), ci->url); - } - else - { - ci->url = NULL; - notice_lang(Config.s_ChanServ, u, CHAN_URL_UNSET, ci->name.c_str()); - } - - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_URL, "SET"); - return true; - } - - void OnSyntaxError(User *u, const ci::string &) - { - // XXX - syntax_error(Config.s_ChanServ, u, "SET", CHAN_SET_SYNTAX); - } - - void OnServHelp(User *u) - { - notice_lang(Config.s_ChanServ, u, CHAN_HELP_CMD_SET_URL); - } -}; - -class CommandCSSASetURL : public CommandCSSetURL -{ - public: - CommandCSSASetURL(const ci::string &cname) : CommandCSSetURL(cname, "chanserv/saset/url") - { - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_URL, "SASET"); - return true; - } - - void OnSyntaxError(User *u, const ci::string &) - { - // XXX - syntax_error(Config.s_ChanServ, u, "SASET URL", CHAN_SASET_SYNTAX); - } -}; - -class CSSetURL : public Module -{ - public: - CSSetURL(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - Command *c = FindCommand(ChanServ, "SET"); - if (c) - c->AddSubcommand(new CommandCSSetURL("URL")); - - c = FindCommand(ChanServ, "SASET"); - if (c) - c->AddSubcommand(new CommandCSSASetURL("URL")); - } - - ~CSSetURL() - { - Command *c = FindCommand(ChanServ, "SET"); - if (c) - c->DelSubcommand("URL"); - - c = FindCommand(ChanServ, "SASET"); - if (c) - c->DelSubcommand("URL"); - } -}; - -MODULE_INIT(CSSetURL) diff --git a/src/core/db_plain.cpp b/src/core/db_plain.cpp index 7aa2ada89..885faf41b 100644 --- a/src/core/db_plain.cpp +++ b/src/core/db_plain.cpp @@ -625,10 +625,6 @@ class DBPlain : public Module nc->email = sstrdup(params[0].c_str()); else if (key == "GREET") nc->greet = sstrdup(params[0].c_str()); - else if (key == "ICQ") - nc->icq = atoi(params[0].c_str()); - else if (key == "URL") - nc->url = sstrdup(params[0].c_str()); else if (key == "ACCESS") nc->AddAccess(params[0]); else if (key == "FLAGS") @@ -728,10 +724,6 @@ class DBPlain : public Module } else if (key == "DESC") ci->desc = sstrdup(params[0].c_str()); - else if (key == "URL") - ci->url = sstrdup(params[0].c_str()); - else if (key == "EMAIL") - ci->email = sstrdup(params[0].c_str()); else if (key == "TOPIC") { ci->last_topic_setter = params[0]; @@ -927,10 +919,6 @@ class DBPlain : public Module db << "MD EMAIL " << nc->email << endl; if (nc->greet) db << "MD GREET :" << nc->greet << endl; - if (nc->icq) - db << "MD ICQ :" << nc->icq << endl; - if (nc->url) - db << "MD URL :" << nc->url << endl; if (!nc->access.empty()) { for (std::vector<std::string>::iterator it = nc->access.begin(), it_end = nc->access.end(); it != it_end; ++it) @@ -1007,10 +995,6 @@ class DBPlain : public Module db << "MD SUCCESSOR " << ci->successor->display << endl; if (ci->desc) db << "MD DESC :" << ci->desc << endl; - if (ci->url) - db << "MD URL :" << ci->url << endl; - if (ci->email) - db << "MD EMAIL :" << ci->email << endl; if (ci->last_topic) db << "MD TOPIC " << ci->last_topic_setter << " " << ci->last_topic_time << " :" << ci->last_topic << endl; db << "MD LEVELS"; diff --git a/src/core/ns_group.cpp b/src/core/ns_group.cpp index 5cec0f99f..6b3e56718 100644 --- a/src/core/ns_group.cpp +++ b/src/core/ns_group.cpp @@ -186,9 +186,6 @@ class CommandNSUngroup : public Command na->nc->email = sstrdup(oldcore->email); if (oldcore->greet) na->nc->greet = sstrdup(oldcore->greet); - na->nc->icq = oldcore->icq; - if (oldcore->url) - na->nc->url = sstrdup(oldcore->url); na->nc->language = oldcore->language; notice_lang(Config.s_NickServ, u, NICK_UNGROUP_SUCCESSFUL, na->nick, oldcore->display); diff --git a/src/core/ns_info.cpp b/src/core/ns_info.cpp index 244f8c190..3109ad4ba 100644 --- a/src/core/ns_info.cpp +++ b/src/core/ns_info.cpp @@ -109,12 +109,8 @@ class CommandNSInfo : public Command if (na->last_quit && (show_hidden || !(na->nc->HasFlag(NI_HIDE_QUIT)))) notice_lang(Config.s_NickServ, u, NICK_INFO_LAST_QUIT, na->last_quit); - if (na->nc->url) - notice_lang(Config.s_NickServ, u, NICK_INFO_URL, na->nc->url); if (na->nc->email && (show_hidden || !(na->nc->HasFlag(NI_HIDE_EMAIL)))) notice_lang(Config.s_NickServ, u, NICK_INFO_EMAIL, na->nc->email); - if (na->nc->icq) - notice_lang(Config.s_NickServ, u, NICK_INFO_ICQ, na->nc->icq); if (show_hidden) { diff --git a/src/core/ns_set_icq.cpp b/src/core/ns_set_icq.cpp deleted file mode 100644 index 1fcce6c40..000000000 --- a/src/core/ns_set_icq.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* NickServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandNSSetICQ : public Command -{ - public: - CommandNSSetICQ(const ci::string &cname) : Command(cname, 0) - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - if (!params.empty()) - { - int32 tmp = atol(params[0].c_str()); - if (!tmp) - notice_lang(Config.s_NickServ, u, NICK_SET_ICQ_INVALID, params[0].c_str()); - else - { - u->Account()->icq = tmp; - notice_lang(Config.s_NickServ, u, NICK_SET_ICQ_CHANGED, params[0].c_str()); - } - } - else - { - u->Account()->icq = 0; - notice_lang(Config.s_NickServ, u, NICK_SET_ICQ_UNSET); - } - - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_NickServ, u, NICK_HELP_SET_ICQ); - return true; - } - - void OnServHelp(User *u) - { - notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SET_ICQ); - } -}; - -class CommandNSSASetICQ : public Command -{ - public: - CommandNSSASetICQ(const ci::string &cname) : Command(cname, 1, 2, "nickserv/saset/icq") - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - NickCore *nc = findcore(params[0]); - assert(nc); - - const char *param = params.size() > 1 ? params[1].c_str() : NULL; - - if (param) - { - int32 tmp = atol(param); - - if (tmp) - notice_lang(Config.s_NickServ, u, NICK_SASET_ICQ_INVALID, param); - else - { - nc->icq = tmp; - notice_lang(Config.s_NickServ, u, NICK_SASET_ICQ_CHANGED, nc->display, param); - } - } - else - { - nc->icq = 0; - notice_lang(Config.s_NickServ, u, NICK_SASET_ICQ_UNSET, nc->display); - } - - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_NickServ, u, NICK_HELP_SASET_ICQ); - return true; - } - - void OnServHelp(User *u) - { - notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SASET_ICQ); - } -}; - -class NSSetICQ : public Module -{ - public: - NSSetICQ(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - Command *c = FindCommand(NickServ, "SET"); - if (c) - c->AddSubcommand(new CommandNSSetICQ("ICQ")); - - c = FindCommand(NickServ, "SASET"); - if (c) - c->AddSubcommand(new CommandNSSASetICQ("ICQ")); - } - - ~NSSetICQ() - { - Command *c = FindCommand(NickServ, "SET"); - if (c) - c->DelSubcommand("ICQ"); - - c = FindCommand(NickServ, "SASET"); - if (c) - c->DelSubcommand("ICQ"); - } -}; - -MODULE_INIT(NSSetICQ) diff --git a/src/core/ns_set_url.cpp b/src/core/ns_set_url.cpp deleted file mode 100644 index 810a43aac..000000000 --- a/src/core/ns_set_url.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* NickServ core functions - * - * (C) 2003-2010 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - * Based on the original code of Epona by Lara. - * Based on the original code of Services by Andy Church. - */ - -/*************************************************************************/ - -#include "module.h" - -class CommandNSSetURL : public Command -{ - public: - CommandNSSetURL(const ci::string &cname) : Command(cname, 0) - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - if (u->Account()->url) - delete [] u->Account()->url; - - if (!params.empty()) - { - u->Account()->url = sstrdup(params[0].c_str()); - notice_lang(Config.s_NickServ, u, NICK_SET_URL_CHANGED, params[0].c_str()); - } - else - { - u->Account()->url = NULL; - notice_lang(Config.s_NickServ, u, NICK_SET_URL_UNSET); - } - - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_NickServ, u, NICK_HELP_SET_URL); - return true; - } - - void OnServHelp(User *u) - { - notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SET_URL); - } -}; - -class CommandNSSASetURL : public Command -{ - public: - CommandNSSASetURL(const ci::string &cname) : Command(cname, 1, 2, "nickserv/saset/url") - { - } - - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) - { - NickCore *nc = findcore(params[0]); - assert(nc); - - const char *param = params.size() > 1 ? params[1].c_str() : NULL; - - if (nc->url) - delete [] nc->url; - - if (param) - { - nc->url = sstrdup(param); - notice_lang(Config.s_NickServ, u, NICK_SASET_URL_CHANGED, nc->display, param); - } - else - { - nc->url = NULL; - notice_lang(Config.s_NickServ, u, NICK_SASET_URL_UNSET, nc->display); - } - - return MOD_CONT; - } - - bool OnHelp(User *u, const ci::string &) - { - notice_help(Config.s_NickServ, u, NICK_HELP_SASET_URL); - return true; - } - - void OnServHelp(User *u) - { - notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_SASET_URL); - } -}; - -class NSSetURL : public Module -{ - public: - NSSetURL(const std::string &modname, const std::string &creator) : Module(modname, creator) - { - this->SetAuthor("Anope"); - this->SetType(CORE); - - Command *c = FindCommand(NickServ, "SET"); - if (c) - c->AddSubcommand(new CommandNSSetURL("URL")); - - c = FindCommand(NickServ, "SASET"); - if (c) - c->AddSubcommand(new CommandNSSASetURL("URL")); - } - - ~NSSetURL() - { - Command *c = FindCommand(NickServ, "SET"); - if (c) - c->DelSubcommand("URL"); - c = FindCommand(NickServ, "SASET"); - if (c) - c->DelSubcommand("URL"); - } -}; - -MODULE_INIT(NSSetURL) |
