From 1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 1 Jul 2013 22:17:52 -0400 Subject: Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module. --- modules/commands/cs_clone.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'modules/commands/cs_clone.cpp') diff --git a/modules/commands/cs_clone.cpp b/modules/commands/cs_clone.cpp index d9ba97894..a1b04d103 100644 --- a/modules/commands/cs_clone.cpp +++ b/modules/commands/cs_clone.cpp @@ -10,6 +10,7 @@ */ #include "module.h" +#include "modules/bs_badwords.h" class CommandCSClone : public Command { @@ -125,12 +126,16 @@ public: } else if (what.equals_ci("BADWORDS")) { - target_ci->ClearBadWords(); - for (unsigned i = 0; i < ci->GetBadWordCount(); ++i) - { - const BadWord *bw = ci->GetBadWord(i); - target_ci->AddBadWord(bw->word, bw->type); - } + BadWords *target_badwords = target_ci->GetExt("badwords"), + *badwords = ci->Require("badwords"); + if (target_badwords) + target_badwords->ClearBadWords(); + if (badwords) + for (unsigned i = 0; i < badwords->GetBadWordCount(); ++i) + { + const BadWord *bw = badwords->GetBadWord(i); + target_badwords->AddBadWord(bw->word, bw->type); + } source.Reply(_("All badword entries from \002%s\002 have been cloned to \002%s\002."), channel.c_str(), target.c_str()); } @@ -141,8 +146,6 @@ public: } Log(LOG_COMMAND, source, this, ci) << "to clone " << (what.empty() ? "everything from it" : what) << " to " << target_ci->name; - - return; } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override -- cgit