summaryrefslogtreecommitdiff
path: root/modules/commands/cs_clone.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-07-01 22:17:52 -0400
committerAdam <Adam@anope.org>2013-07-01 22:17:52 -0400
commit1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch)
treec0ecf92ed768473bc82ff64a7fce827245f37ba9 /modules/commands/cs_clone.cpp
parent518182ac9204f815258b0de91b3f884d8efa1502 (diff)
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.
Diffstat (limited to 'modules/commands/cs_clone.cpp')
-rw-r--r--modules/commands/cs_clone.cpp19
1 files changed, 11 insertions, 8 deletions
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"),
+ *badwords = ci->Require<BadWords>("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