summaryrefslogtreecommitdiff
path: root/modules/chanserv/topic.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2016-10-22 16:43:18 -0400
committerAdam <Adam@anope.org>2016-10-22 16:52:29 -0400
commitfce6169f4e134a99dbb19997337b1bb250889147 (patch)
treeb6f2f6c1bc7094a32b5dc6bb1df97fc4b675e9e0 /modules/chanserv/topic.cpp
parent06f40cabcb167e2764c03092f6ec3f7383983f95 (diff)
Various codestyle cleanup in most of the core modules
Diffstat (limited to 'modules/chanserv/topic.cpp')
-rw-r--r--modules/chanserv/topic.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/modules/chanserv/topic.cpp b/modules/chanserv/topic.cpp
index fe9d2a80f..76a816c13 100644
--- a/modules/chanserv/topic.cpp
+++ b/modules/chanserv/topic.cpp
@@ -73,7 +73,9 @@ class CommandCSSetKeepTopic : public Command
source.Reply(_("Topic retention option for \002{0}\002 is now \002off\002."), ci->GetName());
}
else
+ {
this->OnSyntaxError(source, "KEEPTOPIC");
+ }
}
bool OnHelp(CommandSource &source, const Anope::string &) override
@@ -146,7 +148,9 @@ class CommandCSTopic : public Command
ci->SetLastTopic("");
}
else
+ {
new_topic = topic;
+ }
this->Set(source, ci, new_topic);
}
@@ -168,17 +172,33 @@ class CommandCSTopic : public Command
ChanServ::Channel *ci = ChanServ::Find(channel);
if (ci == NULL)
+ {
source.Reply(_("Channel \002{0}\002 isn't registered."), channel);
- else if (!source.AccessFor(ci).HasPriv("TOPIC") && !source.HasCommand("chanserv/topic"))
+ return;
+ }
+
+ if (!source.AccessFor(ci).HasPriv("TOPIC") && !source.HasCommand("chanserv/topic"))
+ {
source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "TOPIC", ci->GetName());
- else if (subcmd.equals_ci("LOCK"))
+ return;
+ }
+
+ if (subcmd.equals_ci("LOCK"))
+ {
this->Lock(source, ci, params);
+ }
else if (subcmd.equals_ci("UNLOCK"))
+ {
this->Unlock(source, ci, params);
+ }
else if (!ci->c)
+ {
source.Reply(_("Channel \002{0}\002 doesn't exist."), ci->GetName());
+ }
else if (subcmd.equals_ci("APPEND") && params.size() > 2)
+ {
this->Append(source, ci, params);
+ }
else
{
Anope::string topic;
@@ -192,6 +212,7 @@ class CommandCSTopic : public Command
if (params.size() > 2)
topic += " " + params[2];
}
+
this->Set(source, ci, topic);
}
}