summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/chanserv.cpp4
-rw-r--r--src/core/cs_info.cpp4
-rw-r--r--src/core/cs_set_email.cpp103
-rw-r--r--src/core/cs_set_entrymsg.cpp2
-rw-r--r--src/core/cs_set_url.cpp111
-rw-r--r--src/core/db_plain.cpp16
-rw-r--r--src/core/ns_group.cpp3
-rw-r--r--src/core/ns_info.cpp4
-rw-r--r--src/core/ns_set_icq.cpp133
-rw-r--r--src/core/ns_set_url.cpp125
-rw-r--r--src/modules/cs_set_misc.cpp196
-rw-r--r--src/modules/os_info.cpp515
-rw-r--r--src/nickcore.cpp6
-rw-r--r--src/nickserv.cpp2
-rw-r--r--src/regchannel.cpp6
15 files changed, 199 insertions, 1031 deletions
diff --git a/src/chanserv.cpp b/src/chanserv.cpp
index 3ca9694b3..27cb159ce 100644
--- a/src/chanserv.cpp
+++ b/src/chanserv.cpp
@@ -202,10 +202,6 @@ void get_chanserv_stats(long *nrec, long *memuse)
mem += sizeof(*ci);
if (ci->desc)
mem += strlen(ci->desc) + 1;
- if (ci->url)
- mem += strlen(ci->url) + 1;
- if (ci->email)
- mem += strlen(ci->email) + 1;
mem += ci->GetAccessCount() * sizeof(ChanAccess);
mem += ci->GetAkickCount() * sizeof(AutoKick);
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> &params)
- {
- 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> &params)
- {
- 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> &params)
- {
- 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> &params)
- {
- 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> &params)
- {
- 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> &params)
- {
- 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)
diff --git a/src/modules/cs_set_misc.cpp b/src/modules/cs_set_misc.cpp
new file mode 100644
index 000000000..5f690a0ac
--- /dev/null
+++ b/src/modules/cs_set_misc.cpp
@@ -0,0 +1,196 @@
+/* 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 CommandCSSetMisc : public Command
+{
+ std::string Desc;
+ public:
+ CommandCSSetMisc(const ci::string &cname, const std::string &desc, const ci::string &cpermission = "") : Command(cname, 1, 2, cpermission), Desc(desc)
+ {
+ }
+
+ CommandReturn Execute(User *u, const std::vector<ci::string> &params)
+ {
+ ChannelInfo *ci = cs_findchan(params[0]);
+ assert(ci);
+
+ ci->Shrink("chanserv:" + std::string(this->name.c_str()));
+ if (params.size() > 1)
+ {
+ ci->Extend("chanserv:" + std::string(this->name.c_str()), new ExtensibleItemRegular<ci::string>(params[1]));
+ notice_lang(Config.s_ChanServ, u, CHAN_SETTING_CHANGED, this->name.c_str(), ci->name.c_str(), params[1].c_str());
+ }
+ else
+ {
+ notice_lang(Config.s_ChanServ, u, CHAN_SETTING_UNSET, this->name.c_str(), ci->name.c_str());
+ }
+
+ return MOD_CONT;
+ }
+
+ void OnSyntaxError(User *u, const ci::string &)
+ {
+ syntax_error(Config.s_ChanServ, u, "SET", CHAN_SET_SYNTAX);
+ }
+
+ void OnServHelp(User *u)
+ {
+ u->SendMessage(Config.s_ChanServ, " %-10s %s", this->name.c_str(), this->Desc.c_str());
+ }
+};
+
+class CommandCSSASetMisc : public CommandCSSetMisc
+{
+ public:
+ CommandCSSASetMisc(const ci::string &cname, const std::string &desc) : CommandCSSetMisc(cname, desc, "chanserv/saset/" + cname)
+ {
+ }
+
+ void OnSyntaxError(User *u, const ci::string &)
+ {
+ syntax_error(Config.s_ChanServ, u, "SASET", CHAN_SASET_SYNTAX);
+ }
+};
+
+class CSSetMisc : public Module
+{
+ struct CommandInfo
+ {
+ std::string Name;
+ std::string Desc;
+ bool ShowHidden;
+
+ CommandInfo(const std::string &name, const std::string &desc, bool showhidden) : Name(name), Desc(desc), ShowHidden(showhidden) { }
+ };
+
+ std::map<std::string, CommandInfo *> Commands;
+
+ void RemoveAll()
+ {
+ if (Commands.empty())
+ return;
+
+ Command *set = FindCommand(ChanServ, "SET");
+ Command *saset = FindCommand(ChanServ, "SASET");
+
+ if (!set && !saset)
+ return;
+
+ for (std::map<std::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it)
+ {
+ if (set)
+ set->DelSubcommand(it->first.c_str());
+ if (saset)
+ saset->DelSubcommand(it->first.c_str());
+ delete it->second;
+ }
+
+ this->Commands.clear();
+ }
+
+ public:
+ CSSetMisc(const std::string &modname, const std::string &creator) : Module(modname, creator)
+ {
+ this->SetAuthor("Anope");
+ this->SetType(CORE);
+
+ Implementation i[] = { I_OnReload, I_OnChanInfo, I_OnDatabaseWriteMetadata, I_OnDatabaseReadMetadata };
+ ModuleManager::Attach(i, this, 4);
+
+ OnReload(true);
+ }
+
+ ~CSSetMisc()
+ {
+ RemoveAll();
+ }
+
+ void OnReload(bool)
+ {
+ RemoveAll();
+
+ Command *set = FindCommand(ChanServ, "SET");
+ Command *saset = FindCommand(ChanServ, "SASET");
+ if (!set && saset)
+ return;
+
+ ConfigReader config;
+
+ for (int i = 0; true; ++i)
+ {
+ std::string cname = config.ReadValue("cs_set_misc", "name", "", i);
+ if (cname.empty())
+ break;
+ std::string desc = config.ReadValue("cs_set_misc", "desc", "", i);
+ bool showhidden = config.ReadFlag("cs_set_misc", "operonly", "no", i);
+
+ CommandInfo *info = new CommandInfo(cname, desc, showhidden);
+ if (!this->Commands.insert(std::make_pair(cname, info)).second)
+ {
+ Alog() << "cs_set_misc: Warning, unable to add duplicate entry " << cname;
+ delete info;
+ continue;
+ }
+
+ if (set)
+ set->AddSubcommand(new CommandCSSetMisc(cname.c_str(), desc));
+ if (saset)
+ saset->AddSubcommand(new CommandCSSASetMisc(cname.c_str(), desc));
+ }
+ }
+
+ void OnChanInfo(User *u, ChannelInfo *ci, bool ShowHidden)
+ {
+ for (std::map<std::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it)
+ {
+ if (!ShowHidden && it->second->ShowHidden)
+ continue;
+
+ ci::string value;
+ if (ci->GetExtRegular("chanserv:" + it->first, value))
+ {
+ u->SendMessage(Config.s_ChanServ, " %s: %s", it->first.c_str(), value.c_str());
+ }
+ }
+ }
+
+ void OnDatabaseWriteMetadata(void (*WriteMetadata)(const std::string &, const std::string &), ChannelInfo *ci)
+ {
+ for (std::map<std::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it)
+ {
+ ci::string value;
+
+ if (ci->GetExtRegular("chanserv:" + it->first, value))
+ {
+ WriteMetadata(it->first, value.c_str());
+ }
+ }
+ }
+
+ EventReturn OnDatabaseReadMetadata(ChannelInfo *ci, const std::string &key, const std::vector<std::string> &params)
+ {
+ for (std::map<std::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it)
+ {
+ if (key == it->first)
+ {
+ ci->Extend("chanserv:" + it->first, new ExtensibleItemRegular<ci::string>(params[0].c_str()));
+ }
+ }
+
+ return EVENT_CONTINUE;
+ }
+};
+
+MODULE_INIT(CSSetMisc)
diff --git a/src/modules/os_info.cpp b/src/modules/os_info.cpp
deleted file mode 100644
index c9e98ecbc..000000000
--- a/src/modules/os_info.cpp
+++ /dev/null
@@ -1,515 +0,0 @@
-/* os_info.c - Adds oper information lines to nicks/channels
- *
- * (C) 2003-2010 Anope Team
- * Contact us at team@anope.org
- *
- * Based on the original module by Rob <rob@anope.org>
- * Included in the Anope module pack since Anope 1.7.9
- * Anope Coder: DrStein <drstein@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Send bug reports to the Anope Coder instead of the module
- * author, because any changes since the inclusion into anope
- * are not supported by the original author.
- */
-/*************************************************************************/
-
-#include "module.h"
-
-#define AUTHOR "Rob"
-
-/* Multi-language stuff */
-enum
-{
- OINFO_SYNTAX,
- OINFO_ADD_SUCCESS,
- OINFO_DEL_SUCCESS,
- OCINFO_SYNTAX,
- OCINFO_ADD_SUCCESS,
- OCINFO_DEL_SUCCESS,
- OINFO_HELP,
- OCINFO_HELP,
- OINFO_HELP_CMD,
- OCINFO_HELP_CMD,
- LANG_NUM_STRINGS
-};
-
-/*************************************************************************/
-
-static Module *me;
-
-/*************************************************************************/
-
-class CommandNSOInfo : public Command
-{
- private:
- CommandReturn DoAdd(User *u, const std::vector<ci::string> &params)
- {
- const char *nick = params[1].c_str();
- const char *info = params.size() > 2 ? params[2].c_str() : NULL;
- NickAlias *na = NULL;
-
- if (!info)
- {
- this->OnSyntaxError(u, "ADD");
- return MOD_CONT;
- }
-
- if ((na = findnick(nick))) /* ok we've found the user */
- {
- na->nc->Shrink("os_info");
- /* Add the module data to the user */
- na->nc->Extend("os_info", new ExtensibleItemPointerArray<char>(sstrdup(info)));
- me->NoticeLang(Config.s_NickServ, u, OINFO_ADD_SUCCESS, nick);
-
- }
- else /* NickCore not found! */
- notice_lang(Config.s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
-
- return MOD_CONT;
- }
-
- CommandReturn DoDel(User *u, const std::vector<ci::string> &params)
- {
- const char *nick = params[1].c_str();
- NickAlias *na = NULL;
-
- if ((na = findnick(nick))) /* ok we've found the user */
- {
- na->nc->Shrink("os_info");
-
- me->NoticeLang(Config.s_NickServ, u, OINFO_DEL_SUCCESS, nick);
-
- }
- else /* NickCore not found! */
- notice_lang(Config.s_NickServ, u, NICK_X_NOT_REGISTERED, nick);
-
- return MOD_CONT;
- }
- public:
- CommandNSOInfo() : Command("OINFO", 2, 3, "nickserv/oinfo")
- {
- }
-
- CommandReturn Execute(User *u, const std::vector<ci::string> &params)
- {
- ci::string cmd = params[0];
-
- if (cmd == "ADD")
- return this->DoAdd(u, params);
- else if (cmd == "DEL")
- return this->DoDel(u, params);
- else
- this->OnSyntaxError(u, "");
-
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_NickServ, u, OINFO_HELP);
- return true;
- }
-
- void OnSyntaxError(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_NickServ, u, OINFO_SYNTAX);
- }
-
- void OnServHelp(User *u)
- {
- me->NoticeLang(Config.s_NickServ, u, OINFO_HELP_CMD);
- }
-};
-
-class CommandCSOInfo : public Command
-{
- private:
- CommandReturn DoAdd(User *u, const std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- const char *info = params.size() > 2 ? params[2].c_str() : NULL;
- ChannelInfo *ci = cs_findchan(chan);
-
- if (!info)
- {
- this->OnSyntaxError(u, "ADD");
- return MOD_CONT;
- }
-
- ci->Shrink("os_info");
- /* Add the module data to the channel */
- ci->Extend("os_info", new ExtensibleItemPointerArray<char>(sstrdup(info)));
- me->NoticeLang(Config.s_ChanServ, u, OCINFO_ADD_SUCCESS, chan);
-
- return MOD_CONT;
- }
-
- CommandReturn DoDel(User *u, const std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- ChannelInfo *ci = cs_findchan(chan);
-
- /* Del the module data from the channel */
- ci->Shrink("os_info");
- me->NoticeLang(Config.s_ChanServ, u, OCINFO_DEL_SUCCESS, chan);
-
- return MOD_CONT;
- }
- public:
- CommandCSOInfo() : Command("OINFO", 2, 3, "chanserv/oinfo")
- {
- }
-
- CommandReturn Execute(User *u, const std::vector<ci::string> &params)
- {
- ci::string cmd = params[1];
-
- if (cmd == "ADD")
- return this->DoAdd(u, params);
- else if (cmd == "DEL")
- return this->DoDel(u, params);
- else
- this->OnSyntaxError(u, "");
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_ChanServ, u, OCINFO_HELP);
- return true;
- }
-
- void OnSyntaxError(User *u, const ci::string &subcommand)
- {
- me->NoticeLang(Config.s_ChanServ, u, OCINFO_SYNTAX);
- }
-
- void OnServHelp(User *u)
- {
- me->NoticeLang(Config.s_ChanServ, u, OCINFO_HELP_CMD);
- }
-};
-
-class OSInfo : public Module
-{
- public:
- OSInfo(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- me = this;
-
- this->SetAuthor(AUTHOR);
- this->SetType(SUPPORTED);
-
- this->AddCommand(NickServ, new CommandNSOInfo());
- this->AddCommand(ChanServ, new CommandCSOInfo());
-
- const char* langtable_en_us[] = {
- /* OINFO_SYNTAX */
- "Syntax: OINFO [ADD|DEL] nick <info>",
- /* OINFO_ADD_SUCCESS */
- "OperInfo line has been added to nick %s",
- /* OINFO_DEL_SUCCESS */
- "OperInfo line has been removed from nick %s",
- /* OCINFO_SYNTAX */
- "Syntax: OINFO #chan [ADD|DEL] <info>",
- /* OCINFO_ADD_SUCCESS */
- "OperInfo line has been added to channel %s",
- /* OCINFO_DEL_SUCCESS */
- "OperInfo line has been removed from channel %s",
- /* OINFO_HELP */
- "Syntax: OINFO [ADD|DEL] nick <info>\n"
- "Add or Delete Oper information for the given nick\n"
- "This will show up when any oper /ns info nick's the user.\n"
- "and can be used for 'tagging' users etc....",
- /* OCINFO_HELP */
- "Syntax: OINFO #chan [ADD|DEL] <info>\n"
- "Add or Delete Oper information for the given channel\n"
- "This will show up when any oper /cs info's the channel.\n"
- "and can be used for 'tagging' channels etc....",
- /* OINFO_HELP_CMD */
- " OINFO Add / Del an OperInfo line to a nick",
- /* OCINFO_HELP_CMD */
- " OINFO Add / Del an OperInfo line to a channel"
- };
-
- const char* langtable_es[] = {
- /* OINFO_SYNTAX */
- "Sintaxis: OINFO [ADD|DEL] nick <info>",
- /* OINFO_ADD_SUCCESS */
- "Una linea OperInfo ha sido agregada al nick %s",
- /* OINFO_DEL_SUCCESS */
- "La linea OperInfo ha sido removida del nick %s",
- /* OCINFO_SYNTAX */
- "Sintaxis: OINFO [ADD|DEL] chan <info>",
- /* OCINFO_ADD_SUCCESS */
- "Linea OperInfo ha sido agregada al canal %s",
- /* OCINFO_DEL_SUCCESS */
- "La linea OperInfo ha sido removida del canal %s",
- /* OINFO_HELP */
- "Sintaxis: OINFO [ADD|DEL] nick <info>\n"
- "Agrega o elimina informacion para Operadores al nick dado\n"
- "Esto se mostrara cuando cualquier operador haga /ns info nick\n"
- "y puede ser usado para 'marcado' de usuarios, etc....",
- /* OCINFO_HELP */
- "Sintaxis: OINFO [ADD|DEL] chan <info>\n"
- "Agrega o elimina informacion para Operadores al canal dado\n"
- "Esto se mostrara cuando cualquier operador haga /cs info canal\n"
- "y puede ser usado para 'marcado' de canales, etc....",
- /* OINFO_HELP_CMD */
- " OINFO Agrega / Elimina una linea OperInfo al nick",
- /* OCINFO_HELP_CMD */
- " OINFO Agrega / Elimina una linea OperInfo al canal"
- };
-
- const char* langtable_nl[] = {
- /* OINFO_SYNTAX */
- "Gebruik: OINFO [ADD|DEL] nick <info>",
- /* OINFO_ADD_SUCCESS */
- "OperInfo regel is toegevoegd aan nick %s",
- /* OINFO_DEL_SUCCESS */
- "OperInfo regel is weggehaald van nick %s",
- /* OCINFO_SYNTAX */
- "Gebruik: OINFO [ADD|DEL] kanaal <info>",
- /* OCINFO_ADD_SUCCESS */
- "OperInfo regel is toegevoegd aan kanaal %s",
- /* OCINFO_DEL_SUCCESS */
- "OperInfo regel is weggehaald van kanaal %s",
- /* OINFO_HELP */
- "Gebruik: OINFO [ADD|DEL] nick <info>\n"
- "Voeg een Oper informatie regel toe aan de gegeven nick, of\n"
- "verwijder deze. Deze regel zal worden weergegeven wanneer\n"
- "een oper /ns info nick doet voor deze gebruiker, en kan worden\n"
- "gebruikt om een gebruiker te 'markeren' etc...",
- /* OCINFO_HELP */
- "Gebruik: OINFO [ADD|DEL] kanaal <info>\n"
- "Voeg een Oper informatie regel toe aan de gegeven kanaal, of\n"
- "verwijder deze. Deze regel zal worden weergegeven wanneer\n"
- "een oper /cs info kanaal doet voor dit kanaal, en kan worden\n"
- "gebruikt om een kanaal te 'markeren' etc...",
- /* OINFO_HELP_CMD */
- " OINFO Voeg een OperInfo regel toe aan een nick of verwijder deze",
- /* OCINFO_HELP_CMD */
- " OINFO Voeg een OperInfo regel toe aan een kanaal of verwijder deze"
- };
-
- const char* langtable_de[] = {
- /* OINFO_SYNTAX */
- "Syntax: OINFO [ADD|DEL] Nickname <Information>",
- /* OINFO_ADD_SUCCESS */
- "Eine OperInfo Linie wurde zu den Nicknamen %s hinzugefьgt",
- /* OINFO_DEL_SUCCESS */
- "Die OperInfo Linie wurde von den Nicknamen %s enfernt",
- /* OCINFO_SYNTAX */
- "Syntax: OINFO [ADD|DEL] Channel <Information>",
- /* OCINFO_ADD_SUCCESS */
- "Eine OperInfo Linie wurde zu den Channel %s hinzugefьgt",
- /* OCINFO_DEL_SUCCESS */
- "Die OperInfo Linie wurde von den Channel %s enfernt",
- /* OINFO_HELP */
- "Syntax: OINFO [ADD|DEL] Nickname <Information>\n"
- "Addiert oder lцscht eine OperInfo Linie zu den angegebenen\n"
- "Nicknamen.Sie wird angezeigt wenn ein Oper mit /ns info sich\n"
- "ьber den Nicknamen informiert.",
- /* OCINFO_HELP */
- "Syntax: OINFO [ADD|DEL] chan <info>\n"
- "Addiert oder lцscht eine OperInfo Linie zu den angegebenen\n"
- "Channel.Sie wird angezeigt wenn ein Oper mit /cs info sich\n"
- "ьber den Channel informiert.",
- /* OINFO_HELP_CMD */
- " OINFO Addiert / Lцscht eine OperInfo Linie zu / von einen Nicknamen",
- /* OCINFO_HELP_CMD */
- " OINFO Addiert / Lцscht eine OperInfo Linie zu / von einen Channel"
- };
-
- const char* langtable_pt[] = {
- /* OINFO_SYNTAX */
- "Sintaxe: OINFO [ADD|DEL] nick <informaзгo>",
- /* OINFO_ADD_SUCCESS */
- "A linha OperInfo foi adicionada ao nick %s",
- /* OINFO_DEL_SUCCESS */
- "A linha OperInfo foi removida do nick %s",
- /* OCINFO_SYNTAX */
- "Sintaxe: OINFO [ADD|DEL] canal <informaзгo>",
- /* OCINFO_ADD_SUCCESS */
- "A linha OperInfo foi adicionada ao canal %s",
- /* OCINFO_DEL_SUCCESS */
- "A linha OperInfo foi removida do canal %s",
- /* OINFO_HELP */
- "Sintaxe: OINFO [ADD|DEL] nick <informaзгo>\n"
- "Adiciona ou apaga informaзгo para Operadores ao nick fornecido\n"
- "Isto serб mostrado quando qualquer Operador usar /ns info nick\n"
- "e pode ser usado para 'etiquetar' usuбrios etc...",
- /* OCINFO_HELP */
- "Sintaxe: OINFO [ADD|DEL] canal <informaзгo>\n"
- "Adiciona ou apaga informaзгo para Operadores ao canal fornecido\n"
- "Isto serб mostrado quando qualquer Operador usar /cs info canal\n"
- "e pode ser usado para 'etiquetar' canais etc...",
- /* OINFO_HELP_CMD */
- " OINFO Adiciona ou Apaga a linha OperInfo para um nick",
- /* OCINFO_HELP_CMD */
- " OINFO Adiciona ou Apaga a linha OperInfo para um canal"
- };
-
- const char* langtable_ru[] = {
- /* OINFO_SYNTAX */
- "Синтаксис: OINFO ADD|DEL ник тест",
- /* OINFO_ADD_SUCCESS */
- "Опер-Информация для ника %s добавлена",
- /* OINFO_DEL_SUCCESS */
- "Опер-Информация для ника %s была удалена",
- /* OCINFO_SYNTAX */
- "Синтаксис: OINFO ADD|DEL #канал текст",
- /* OCINFO_ADD_SUCCESS */
- "Опер-Информация для канала %s успешно установлена",
- /* OCINFO_DEL_SUCCESS */
- "Опер-Информация для канала %s была удалена",
- /* OINFO_HELP */
- "Синтаксис: OINFO ADD|DEL ник текст\n"
- "Устанавливает или удаляет Опер-Информацию для указанного ника,\n"
- "которая будет показана любому оператору, запрашивающему INFO ника.\n"
- "Может быть использована для 'пометки' пользователей и т. д...",
- /* OCINFO_HELP */
- "Синтаксис: OINFO ADD|DEL #канал текст\n"
- "Устанавливает или удаляет Опер-Информацию для указанного канала,\n"
- "которая будет показана любому оператору, запрашивающему INFO канала.\n"
- "Может быть использована для 'пометки' каналов и т. д...",
- /* OINFO_HELP_CMD */
- " OINFO Добавляет/Удаляет опер-инфо для ника",
- /* OCINFO_HELP_CMD */
- " OINFO Добавляет/Удаляет опер-инфо для канала"
- };
-
- const char* langtable_it[] = {
- /* OINFO_SYNTAX */
- "Sintassi: OINFO [ADD|DEL] nick <info>",
- /* OINFO_ADD_SUCCESS */
- "Linea OperInfo aggiunta al nick %s",
- /* OINFO_DEL_SUCCESS */
- "Linea OperInfo rimossa dal nick %s",
- /* OCINFO_SYNTAX */
- "Sintassi: OINFO [ADD|DEL] chan <info>",
- /* OCINFO_ADD_SUCCESS */
- "Linea OperInfo aggiunta al canale %s",
- /* OCINFO_DEL_SUCCESS */
- "Linea OperInfo rimossa dal canale %s",
- /* OINFO_HELP */
- "Sintassi: OINFO [ADD|DEL] nick <info>\n"
- "Aggiunge o rimuove informazioni Oper per il nick specificato\n"
- "Queste vengono mostrate quando un oper esegue il comando /ns info <nick>\n"
- "e possono essere utilizzate per 'marchiare' gli utenti ecc...",
- /* OCINFO_HELP */
- "Sintassi: OINFO [ADD|DEL] chan <info>\n"
- "Aggiunge o rimuove informazioni Oper per il canale specificato\n"
- "Queste vengono mostrate quando un oper esegue il comando /cs info <canale>\n"
- "e possono essere utilizzate per 'marchiare' i canali ecc...",
- /* OINFO_HELP_CMD */
- " OINFO Aggiunge/Rimuove una linea OperInfo ad/da un nick",
- /* OCINFO_HELP_CMD */
- " OINFO Aggiunge/Rimuove una linea OperInfo ad/da un canale"
- };
-
- this->InsertLanguage(LANG_EN_US, LANG_NUM_STRINGS, langtable_en_us);
- this->InsertLanguage(LANG_ES, LANG_NUM_STRINGS, langtable_es);
- this->InsertLanguage(LANG_NL, LANG_NUM_STRINGS, langtable_nl);
- this->InsertLanguage(LANG_DE, LANG_NUM_STRINGS, langtable_de);
- this->InsertLanguage(LANG_PT, LANG_NUM_STRINGS, langtable_pt);
- this->InsertLanguage(LANG_RU, LANG_NUM_STRINGS, langtable_ru);
- this->InsertLanguage(LANG_IT, LANG_NUM_STRINGS, langtable_it);
-
- Implementation i[] = { I_OnNickInfo, I_OnChanInfo, I_OnDatabaseReadMetadata, I_OnDatabaseWriteMetadata };
- ModuleManager::Attach(i, this, 4);
- }
-
- ~OSInfo()
- {
- OnSaveDatabase();
-
- for (nickcore_map::const_iterator it = NickCoreList.begin(), it_end = NickCoreList.end(); it != it_end; ++it)
- {
- NickCore *nc = it->second;
-
- nc->Shrink("os_info");
- }
-
- for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it)
- {
- ChannelInfo *ci = it->second;
-
- ci->Shrink("os_info");
- }
- }
-
- void OnNickInfo(User *u, NickAlias *na, bool)
- {
- if (is_oper(u))
- {
- char *c;
- if (na->nc->GetExtArray("os_info", c))
- u->SendMessage(Config.s_NickServ, " OperInfo: %s", c);
- }
- }
-
- void OnChanInfo(User *u, ChannelInfo *ci, bool)
- {
- if (is_oper(u))
- {
- char *c;
- if (ci->GetExtArray("os_info", c))
- u->SendMessage(Config.s_ChanServ, " OperInfo: %s", c);
- }
- }
-
- void OnDatabaseWriteMetadata(void (*WriteMetadata)(const std::string &, const std::string &), NickCore *nc)
- {
- char *c;
-
- if (nc->GetExtArray("os_info", c))
- {
- std::string buf = ":";
- buf += c;
- WriteMetadata("OS_INFO", buf.c_str());
- }
- }
-
- void OnDatabaseWriteMetadata(void (*WriteMetadata)(const std::string &, const std::string &), ChannelInfo *ci)
- {
- char *c;
-
- if (ci->GetExtArray("os_info", c))
- {
- std::string buf = ":";
- buf += c;
- WriteMetadata("OS_INFO", buf.c_str());
- }
- }
-
- EventReturn OnDatabaseReadMetadata(NickCore *nc, const std::string &key, const std::vector<std::string> &params)
- {
- if (key == "OS_INFO")
- {
- nc->Shrink("os_info");
- nc->Extend("os_info", new ExtensibleItemPointerArray<char>(sstrdup(params[0].c_str()))); /// We really should use std::string here...
-
- return EVENT_STOP;
- }
-
- return EVENT_CONTINUE;
- }
-
- EventReturn OnDatabaseReadMetadata(ChannelInfo *ci, const std::string &key, const std::vector<std::string> &params)
- {
- if (key == "OS_INFO")
- {
- ci->Shrink("os_info");
- ci->Extend("os_info", new ExtensibleItemPointerArray<char>(sstrdup(params[0].c_str())));
-
- return EVENT_STOP;
- }
-
- return EVENT_CONTINUE;
- }
-};
-
-MODULE_INIT(OSInfo)
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 9d51422c9..6c9392aef 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -9,9 +9,8 @@ NickCore::NickCore(const std::string &coredisplay)
if (coredisplay.empty())
throw CoreException("Empty display passed to NickCore constructor");
- display = email = greet = url = NULL;
+ display = email = greet = NULL;
ot = NULL;
- icq = 0;
language = channelcount = 0;
lastmail = 0;
@@ -63,9 +62,6 @@ NickCore::~NickCore()
delete [] this->email;
if (this->greet)
delete [] this->greet;
- if (this->url)
- delete [] this->url;
-
if (!this->memos.memos.empty())
{
for (unsigned i = 0, end = this->memos.memos.size(); i < end; ++i)
diff --git a/src/nickserv.cpp b/src/nickserv.cpp
index 8d59ae672..70cc3d654 100644
--- a/src/nickserv.cpp
+++ b/src/nickserv.cpp
@@ -123,8 +123,6 @@ void get_core_stats(long *nrec, long *memuse)
mem += strlen(nc->display) + 1;
if (!nc->pass.empty())
mem += (nc->pass.capacity() + (2 * sizeof(size_t)) + (2 * sizeof(void *)));
- if (nc->url)
- mem += strlen(nc->url) + 1;
if (nc->email)
mem += strlen(nc->email) + 1;
if (nc->greet)
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index c4c29c0c4..4670bc109 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -22,7 +22,7 @@ ChannelInfo::ChannelInfo(const std::string &chname)
throw CoreException("Empty channel passed to ChannelInfo constructor");
founder = successor = NULL;
- desc = url = email = last_topic = forbidby = forbidreason = NULL;
+ desc = last_topic = forbidby = forbidreason = NULL;
last_topic_time = 0;
levels = NULL;
entry_message = NULL;
@@ -83,10 +83,6 @@ ChannelInfo::~ChannelInfo()
if (this->desc)
delete [] this->desc;
- if (this->url)
- delete [] this->url;
- if (this->email)
- delete [] this->email;
if (this->entry_message)
delete [] this->entry_message;