summaryrefslogtreecommitdiff
path: root/modules/core/cs_set_description.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-07-14 18:29:03 -0400
committerAdam <Adam@anope.org>2011-07-14 18:29:03 -0400
commit5bf7dee559dd576b454537aec439c56c75e556dc (patch)
tree8e2c3be4306f1c3a62f61894b58a55990cbf0989 /modules/core/cs_set_description.cpp
parentf858164deed48f2dcacd5ffc06a55398a54da7e8 (diff)
Made channel descriptions optional
Diffstat (limited to 'modules/core/cs_set_description.cpp')
-rw-r--r--modules/core/cs_set_description.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/modules/core/cs_set_description.cpp b/modules/core/cs_set_description.cpp
index 0be0099b0..726ea5655 100644
--- a/modules/core/cs_set_description.cpp
+++ b/modules/core/cs_set_description.cpp
@@ -16,10 +16,10 @@
class CommandCSSetDescription : public Command
{
public:
- CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description", const Anope::string &cpermission = "") : Command(creator, cname, 2, 2, cpermission)
+ CommandCSSetDescription(Module *creator, const Anope::string &cname = "chanserv/set/description", const Anope::string &cpermission = "") : Command(creator, cname, 1, 2, cpermission)
{
this->SetDesc(_("Set the channel description"));
- this->SetSyntax(_("\037channel\037 DESC \037description\037"));
+ this->SetSyntax(_("\037channel\037 DESC [\037description\037]"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -38,9 +38,16 @@ class CommandCSSetDescription : public Command
return;
}
- ci->desc = params[1];
-
- source.Reply(_("Description of %s changed to \002%s\002."), ci->name.c_str(), ci->desc.c_str());
+ if (params.size() > 1)
+ {
+ ci->desc = params[1];
+ source.Reply(_("Description of %s changed to \002%s\002."), ci->name.c_str(), ci->desc.c_str());
+ }
+ else
+ {
+ ci->desc.clear();
+ source.Reply(_("Description of %s unset."), ci->name.c_str());
+ }
return;
}