summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby- <robby@chat.be>2013-09-29 08:55:32 +0200
committerAdam <Adam@anope.org>2013-09-29 15:42:22 -0400
commited06609ae1b100997981a3c91bcf46d7a31bc7bd (patch)
tree183d41ecc968d0385d3f01b61fc67c5aa492f36a
parent32a57150ecddc75b1bfd2efc185575b76431cbff (diff)
NickServ: Change a few log wordings and add missing log calls to some commands.
ns_suspend and cs_suspend: Fix log wording, and correct syntax to show the reason is optional.
-rw-r--r--modules/commands/cs_seen.cpp2
-rw-r--r--modules/commands/cs_suspend.cpp4
-rw-r--r--modules/commands/ns_access.cpp6
-rw-r--r--modules/commands/ns_ajoin.cpp4
-rw-r--r--modules/commands/ns_alist.cpp2
-rw-r--r--modules/commands/ns_cert.cpp38
-rw-r--r--modules/commands/ns_group.cpp4
-rw-r--r--modules/commands/ns_info.cpp4
-rw-r--r--modules/commands/ns_suspend.cpp4
9 files changed, 42 insertions, 26 deletions
diff --git a/modules/commands/cs_seen.cpp b/modules/commands/cs_seen.cpp
index b483e9e74..1af50ddd3 100644
--- a/modules/commands/cs_seen.cpp
+++ b/modules/commands/cs_seen.cpp
@@ -116,7 +116,7 @@ class CommandOSSeen : public Command
CommandOSSeen(Module *creator) : Command(creator, "operserv/seen", 1, 2)
{
this->SetDesc(_("Statistics and maintenance for seen data"));
- this->SetSyntax(_("STATS"));
+ this->SetSyntax("STATS");
this->SetSyntax(_("CLEAR \037time\037"));
}
diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp
index ca2fd0893..389440373 100644
--- a/modules/commands/cs_suspend.cpp
+++ b/modules/commands/cs_suspend.cpp
@@ -56,7 +56,7 @@ class CommandCSSuspend : public Command
CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 2, 3)
{
this->SetDesc(_("Prevent a channel from being used preserving channel data and settings"));
- this->SetSyntax(_("\037channel\037 [+\037expiry\037] \037reason\037"));
+ this->SetSyntax(_("\037channel\037 [+\037expiry\037] [\037reason\037]"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
@@ -121,7 +121,7 @@ class CommandCSSuspend : public Command
ci->c->Kick(NULL, users[i], "%s", !reason.empty() ? reason.c_str() : Language::Translate(users[i], _("This channel has been suspended.")));
}
- Log(LOG_ADMIN, source, this, ci) << (!reason.empty() ? reason : "No reason") << ", expires in " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never");
+ Log(LOG_ADMIN, source, this, ci) << " (" << (!reason.empty() ? reason : "No reason") << "), expires on " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never");
source.Reply(_("Channel \002%s\002 is now suspended."), ci->name.c_str());
FOREACH_MOD(OnChanSuspend, (ci));
diff --git a/modules/commands/ns_access.cpp b/modules/commands/ns_access.cpp
index 2d18678bd..5adf17120 100644
--- a/modules/commands/ns_access.cpp
+++ b/modules/commands/ns_access.cpp
@@ -41,6 +41,7 @@ class CommandNSAccess : public Command
}
nc->AddAccess(mask);
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to ADD mask " << mask << " to " << nc->display;
source.Reply(_("\002%s\002 added to %s's access list."), mask.c_str(), nc->display.c_str());
return;
@@ -66,8 +67,9 @@ class CommandNSAccess : public Command
return;
}
- source.Reply(_("\002%s\002 deleted from %s's access list."), mask.c_str(), nc->display.c_str());
nc->EraseAccess(mask);
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to DELETE mask " << mask << " from " << nc->display;
+ source.Reply(_("\002%s\002 deleted from %s's access list."), mask.c_str(), nc->display.c_str());
return;
}
@@ -76,6 +78,8 @@ class CommandNSAccess : public Command
{
unsigned i, end;
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to view the access list for " << nc->display;
+
if (nc->access.empty())
{
source.Reply(_("%s's access list is empty."), nc->display.c_str());
diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp
index 85c15c236..f4f2670f2 100644
--- a/modules/commands/ns_ajoin.cpp
+++ b/modules/commands/ns_ajoin.cpp
@@ -92,6 +92,8 @@ class CommandNSAJoin : public Command
{
AJoinList *channels = nc->Require<AJoinList>("ajoinlist");
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to view the auto join list for " << nc->display;
+
if ((*channels)->empty())
source.Reply(_("%s's auto join list is empty."), nc->display.c_str());
else
@@ -140,6 +142,7 @@ class CommandNSAJoin : public Command
entry->channel = chan;
entry->key = key;
(*channels)->push_back(entry);
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to ADD channel " << chan << " to " << nc->display;
source.Reply(_("%s added to %s's auto join list."), chan.c_str(), nc->display.c_str());
}
}
@@ -158,6 +161,7 @@ class CommandNSAJoin : public Command
else
{
delete (*channels)->at(i);
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to DELETE channel " << chan << " from " << nc->display;
source.Reply(_("%s was removed from %s's auto join list."), chan.c_str(), nc->display.c_str());
}
diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp
index c80a479fc..467504022 100644
--- a/modules/commands/ns_alist.cpp
+++ b/modules/commands/ns_alist.cpp
@@ -42,6 +42,8 @@ class CommandNSAList : public Command
nc = na->nc;
}
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to view the channel access list for " << nc->display;
+
ListFormatter list(source.GetAccount());
int chan_count = 0;
diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp
index 5bb3487b1..ed7140dd5 100644
--- a/modules/commands/ns_cert.cpp
+++ b/modules/commands/ns_cert.cpp
@@ -134,7 +134,7 @@ struct NSCertListImpl : NSCertList
class CommandNSCert : public Command
{
private:
- void DoAdd(CommandSource &source, NickCore *nc, const Anope::string &mask)
+ void DoAdd(CommandSource &source, NickCore *nc, const Anope::string &certfp)
{
NSCertList *cl = nc->Require<NSCertList>("certificates");
@@ -144,11 +144,12 @@ class CommandNSCert : public Command
return;
}
- if (mask.empty())
+ if (certfp.empty())
{
if (source.GetUser() && !source.GetUser()->fingerprint.empty() && !cl->FindCert(source.GetUser()->fingerprint))
{
cl->AddCert(source.GetUser()->fingerprint);
+ Log(LOG_COMMAND, source, this) << "to ADD its current certificate fingerprint " << source.GetUser()->fingerprint;
source.Reply(_("\002%s\002 added to your certificate list."), source.GetUser()->fingerprint.c_str());
}
else
@@ -157,25 +158,27 @@ class CommandNSCert : public Command
return;
}
- if (cl->FindCert(mask))
+ if (cl->FindCert(certfp))
{
- source.Reply(_("Fingerprint \002%s\002 already present on %s's certificate list."), mask.c_str(), nc->display.c_str());
+ source.Reply(_("Fingerprint \002%s\002 already present on %s's certificate list."), certfp.c_str(), nc->display.c_str());
return;
}
- cl->AddCert(mask);
- source.Reply(_("\002%s\002 added to %s's certificate list."), mask.c_str(), nc->display.c_str());
+ cl->AddCert(certfp);
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to ADD certificate fingerprint " << certfp << " to " << nc->display;
+ source.Reply(_("\002%s\002 added to %s's certificate list."), certfp.c_str(), nc->display.c_str());
}
- void DoDel(CommandSource &source, NickCore *nc, const Anope::string &mask)
+ void DoDel(CommandSource &source, NickCore *nc, const Anope::string &certfp)
{
NSCertList *cl = nc->Require<NSCertList>("certificates");
- if (mask.empty())
+ if (certfp.empty())
{
if (source.GetUser() && !source.GetUser()->fingerprint.empty() && cl->FindCert(source.GetUser()->fingerprint))
{
cl->EraseCert(source.GetUser()->fingerprint);
+ Log(LOG_COMMAND, source, this) << "to DELETE its current certificate fingerprint " << source.GetUser()->fingerprint;
source.Reply(_("\002%s\002 deleted from your certificate list."), source.GetUser()->fingerprint.c_str());
}
else
@@ -184,21 +187,24 @@ class CommandNSCert : public Command
return;
}
- if (!cl->FindCert(mask))
+ if (!cl->FindCert(certfp))
{
- source.Reply(_("\002%s\002 not found on %s's certificate list."), mask.c_str(), nc->display.c_str());
+ source.Reply(_("\002%s\002 not found on %s's certificate list."), certfp.c_str(), nc->display.c_str());
return;
}
- source.Reply(_("\002%s\002 deleted from %s's certificate list."), mask.c_str(), nc->display.c_str());
- cl->EraseCert(mask);
+ cl->EraseCert(certfp);
cl->Check();
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to DELETE certificate fingerprint " << certfp << " from " << nc->display;
+ source.Reply(_("\002%s\002 deleted from %s's certificate list."), certfp.c_str(), nc->display.c_str());
}
void DoList(CommandSource &source, const NickCore *nc)
{
NSCertList *cl = nc->GetExt<NSCertList>("certificates");
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to view the certificate fingerprint list for " << nc->display;
+
if (!cl || !cl->GetCertCount())
{
source.Reply(_("%s's certificate list is empty."), nc->display.c_str());
@@ -225,14 +231,14 @@ class CommandNSCert : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
const Anope::string &cmd = params[0];
- Anope::string nick, mask;
+ Anope::string nick, certfp;
if (cmd.equals_ci("LIST"))
nick = params.size() > 1 ? params[1] : "";
else
{
nick = params.size() == 3 ? params[1] : "";
- mask = params.size() > 1 ? params[params.size() - 1] : "";
+ certfp = params.size() > 1 ? params[params.size() - 1] : "";
}
NickCore *nc;
@@ -267,9 +273,9 @@ class CommandNSCert : public Command
else if (Anope::ReadOnly)
source.Reply(READ_ONLY_MODE);
else if (cmd.equals_ci("ADD"))
- return this->DoAdd(source, nc, mask);
+ return this->DoAdd(source, nc, certfp);
else if (cmd.equals_ci("DEL"))
- return this->DoDel(source, nc, mask);
+ return this->DoDel(source, nc, certfp);
else
this->OnSyntaxError(source, "");
}
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp
index ad2a74e38..81daddf84 100644
--- a/modules/commands/ns_group.cpp
+++ b/modules/commands/ns_group.cpp
@@ -46,7 +46,7 @@ class NSGroupRequest : public IdentifyRequest
u->Login(target->nc);
FOREACH_MOD(OnNickGroup, (u, target));
- Log(LOG_COMMAND, source, cmd) << "makes " << nick << " join group of " << target->nick << " (" << target->nc->display << ") (email: " << (!target->nc->email.empty() ? target->nc->email : "none") << ")";
+ Log(LOG_COMMAND, source, cmd) << "to make " << nick << " join group of " << target->nick << " (" << target->nc->display << ") (email: " << (!target->nc->email.empty() ? target->nc->email : "none") << ")";
source.Reply(_("You are now in the group of \002%s\002."), target->nick.c_str());
u->lastnickreg = Anope::CurTime;
@@ -120,7 +120,7 @@ class CommandNSGroup : public Command
source.Reply(_("Please wait %d seconds before using the GROUP command again."), (reg_delay + u->lastnickreg) - Anope::CurTime);
else if (target->nc->HasExt("NS_SUSPENDED"))
{
- Log(LOG_COMMAND, source, this) << "tried to use GROUP for SUSPENDED nick " << target->nick;
+ Log(LOG_COMMAND, source, this) << "and tried to group to SUSPENDED nick " << target->nick;
source.Reply(NICK_X_SUSPENDED, target->nick.c_str());
}
else if (na && *target->nc == *na->nc)
diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp
index c2b09981e..e9a755779 100644
--- a/modules/commands/ns_info.cpp
+++ b/modules/commands/ns_info.cpp
@@ -182,13 +182,13 @@ class CommandNSSetHide : public Command
if (arg.equals_ci("ON"))
{
- Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change hide " << param << " to " << arg << " for " << nc->display;
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change hide " << param.upper() << " to " << arg.upper() << " for " << nc->display;
nc->Extend<bool>(flag);
source.Reply(onmsg.c_str(), nc->display.c_str(), source.service->nick.c_str());
}
else if (arg.equals_ci("OFF"))
{
- Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change hide " << param << " to " << arg << " for " << nc->display;
+ Log(nc == source.GetAccount() ? LOG_COMMAND : LOG_ADMIN, source, this) << "to change hide " << param.upper() << " to " << arg.upper() << " for " << nc->display;
nc->Shrink<bool>(flag);
source.Reply(offmsg.c_str(), nc->display.c_str(), source.service->nick.c_str());
}
diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp
index 6625a63ec..ae0d85206 100644
--- a/modules/commands/ns_suspend.cpp
+++ b/modules/commands/ns_suspend.cpp
@@ -58,7 +58,7 @@ class CommandNSSuspend : public Command
CommandNSSuspend(Module *creator) : Command(creator, "nickserv/suspend", 2, 3)
{
this->SetDesc(_("Suspend a given nick"));
- this->SetSyntax(_("\037nickname\037 [+\037expiry\037] \037reason\037"));
+ this->SetSyntax(_("\037nickname\037 [+\037expiry\037] [\037reason\037]"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
@@ -134,7 +134,7 @@ class CommandNSSuspend : public Command
}
}
- Log(LOG_ADMIN, source, this) << "for " << nick << " (" << (!reason.empty() ? reason : "No reason") << "), expires in " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never");
+ Log(LOG_ADMIN, source, this) << "for " << nick << " (" << (!reason.empty() ? reason : "No reason") << "), expires on " << (expiry_secs ? Anope::strftime(Anope::CurTime + expiry_secs) : "never");
source.Reply(_("Nick %s is now suspended."), nick.c_str());
FOREACH_MOD(OnNickSuspend, (na));