1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 04:36:38 +02:00

Made channel descriptions optional

This commit is contained in:
Adam
2011-07-14 18:29:03 -04:00
parent f858164dee
commit 5bf7dee559
3 changed files with 20 additions and 11 deletions
+12 -5
View File
@@ -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;
}