summaryrefslogtreecommitdiff
path: root/modules/commands/cs_appendtopic.cpp
diff options
context:
space:
mode:
authorRobby <robby@chat.be>2012-01-07 04:10:30 -0500
committerAdam <Adam@anope.org>2012-01-07 04:10:30 -0500
commit9e713941277e8d745b1713a6500349a9d1ecb8e3 (patch)
tree8f6d8a8553316799154884f61573036c97ca0fff /modules/commands/cs_appendtopic.cpp
parentdd64eac782b3ee5acc6d1068a0ef42142a035254 (diff)
Cleaned up a lot of log messages, help replies, fixed cs_tban, and other small fixes
Diffstat (limited to 'modules/commands/cs_appendtopic.cpp')
-rw-r--r--modules/commands/cs_appendtopic.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/modules/commands/cs_appendtopic.cpp b/modules/commands/cs_appendtopic.cpp
index 2c2b7253f..4186bdaff 100644
--- a/modules/commands/cs_appendtopic.cpp
+++ b/modules/commands/cs_appendtopic.cpp
@@ -45,6 +45,7 @@ class CommandCSAppendTopic : public Command
CommandCSAppendTopic(Module *creator) : Command(creator, "chanserv/appendtopic", 2, 2)
{
this->SetDesc(_("Add text to a channels topic"));
+ this->SetSyntax(_("\037channel\037 \037text\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -58,7 +59,7 @@ class CommandCSAppendTopic : public Command
source.Reply(CHAN_X_NOT_IN_USE, params[0].c_str());
else if (!c->ci)
source.Reply(CHAN_X_NOT_REGISTERED, c->name.c_str());
- else if (!c->ci->AccessFor(u).HasPriv("TOPIC"))
+ else if (!c->ci->AccessFor(u).HasPriv("TOPIC") && !u->HasCommand("chanserv/topic"))
source.Reply(ACCESS_DENIED);
else
{
@@ -77,15 +78,15 @@ class CommandCSAppendTopic : public Command
if (has_topiclock)
c->ci->SetFlag(CI_TOPICLOCK);
- bool override = c->ci->AccessFor(u).HasPriv("TOPIC");
- Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci) << "changed topic to " << topic;
+ bool override = !c->ci->AccessFor(u).HasPriv("TOPIC");
+ Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, c->ci) << "to append: " << topic;
}
return;
}
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
- source.Reply(_("Syntax: APPENDTOPIC channel text"));
+ this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("This command allows users to append text to a currently set\n"
"channel topic. When TOPICLOCK is on, the topic is updated and\n"
@@ -93,11 +94,6 @@ class CommandCSAppendTopic : public Command
return true;
}
-
- void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
- {
- source.Reply(_("Syntax: APPENDTOPIC channel text"));
- }
};
class CSAppendTopic : public Module