diff options
author | Robby- <robby@chat.be> | 2013-09-24 06:04:59 +0200 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-27 19:11:02 -0400 |
commit | 12a0311aaa783385bba3194e92ed0eb4665621ed (patch) | |
tree | 11ed0b90d0a6454a7d87cbdee137c7438ab21064 /modules/commands | |
parent | cf653fc08429054e5451482166622fc8db8fec1f (diff) |
Add missing columns to os_forbid. Make most lists with dates use the shorter output format.
Diffstat (limited to 'modules/commands')
-rw-r--r-- | modules/commands/cs_akick.cpp | 13 | ||||
-rw-r--r-- | modules/commands/cs_entrymsg.cpp | 2 | ||||
-rw-r--r-- | modules/commands/cs_mode.cpp | 2 | ||||
-rw-r--r-- | modules/commands/hs_list.cpp | 4 | ||||
-rw-r--r-- | modules/commands/hs_request.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_akill.cpp | 7 | ||||
-rw-r--r-- | modules/commands/os_forbid.cpp | 14 | ||||
-rw-r--r-- | modules/commands/os_ignore.cpp | 4 | ||||
-rw-r--r-- | modules/commands/os_news.cpp | 2 | ||||
-rw-r--r-- | modules/commands/os_sxline.cpp | 7 |
10 files changed, 29 insertions, 28 deletions
diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 2a0d623af..ecad59142 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -257,12 +257,11 @@ class CommandCSAKick : public Command { class AkickListCallback : public NumberList { - CommandSource &source; ListFormatter &list; ChannelInfo *ci; public: - AkickListCallback(CommandSource &_source, ListFormatter &_list, ChannelInfo *_ci, const Anope::string &numlist) : NumberList(numlist, false), source(_source), list(_list), ci(_ci) + AkickListCallback(ListFormatter &_list, ChannelInfo *_ci, const Anope::string &numlist) : NumberList(numlist, false), list(_list), ci(_ci) { } @@ -275,11 +274,11 @@ class CommandCSAKick : public Command Anope::string timebuf, lastused; if (akick->addtime) - timebuf = Anope::strftime(akick->addtime, source.GetAccount(), false); + timebuf = Anope::strftime(akick->addtime, NULL, true); else timebuf = UNKNOWN; if (akick->last_used) - lastused = Anope::strftime(akick->last_used, source.GetAccount(), false); + lastused = Anope::strftime(akick->last_used, NULL, true); else lastused = UNKNOWN; @@ -296,7 +295,7 @@ class CommandCSAKick : public Command this->list.AddEntry(entry); } } - nl_list(source, list, ci, mask); + nl_list(list, ci, mask); nl_list.Process(); } else @@ -315,11 +314,11 @@ class CommandCSAKick : public Command Anope::string timebuf, lastused; if (akick->addtime) - timebuf = Anope::strftime(akick->addtime, source.GetAccount()); + timebuf = Anope::strftime(akick->addtime, NULL, true); else timebuf = UNKNOWN; if (akick->last_used) - lastused = Anope::strftime(akick->last_used, source.GetAccount()); + lastused = Anope::strftime(akick->last_used, NULL, true); else lastused = UNKNOWN; diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 3cf14e523..032d023eb 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -118,7 +118,7 @@ class CommandEntryMessage : public Command ListFormatter::ListEntry entry; entry["Number"] = stringify(i + 1); entry["Creator"] = msg->creator; - entry["Created"] = Anope::strftime(msg->when, source.GetAccount()); + entry["Created"] = Anope::strftime(msg->when, NULL, true); entry["Message"] = msg->message; list.AddEntry(entry); } diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 1d3050f32..69644748f 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -436,7 +436,7 @@ class CommandCSMode : public Command entry["Mode"] = Anope::printf("%c%c", ml->set ? '+' : '-', cm->mchar); entry["Param"] = ml->param; entry["Creator"] = ml->setter; - entry["Created"] = Anope::strftime(ml->created, source.nc, false); + entry["Created"] = Anope::strftime(ml->created, NULL, true); list.AddEntry(entry); } diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index 5e7b4beb8..e94c67ae2 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -78,7 +78,7 @@ class CommandHSList : public Command else entry["Vhost"] = na->GetVhostHost(); entry["Creator"] = na->GetVhostCreator(); - entry["Created"] = Anope::strftime(na->GetVhostCreated(), source.GetAccount()); + entry["Created"] = Anope::strftime(na->GetVhostCreated(), NULL, true); list.AddEntry(entry); } } @@ -99,7 +99,7 @@ class CommandHSList : public Command else entry["Vhost"] = na->GetVhostHost(); entry["Creator"] = na->GetVhostCreator(); - entry["Created"] = Anope::strftime(na->GetVhostCreated(), source.GetAccount()); + entry["Created"] = Anope::strftime(na->GetVhostCreated(), NULL, true); list.AddEntry(entry); } } diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index 3b3865c41..24e13b176 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -317,7 +317,7 @@ class CommandHSWaiting : public Command entry["Vhost"] = hr->ident + "@" + hr->host; else entry["Vhost"] = hr->host; - entry["Created"] = Anope::strftime(hr->time, source.GetAccount()); + entry["Created"] = Anope::strftime(hr->time, NULL, true); list.AddEntry(entry); } ++counter; diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index fd58e0ce0..b945058da 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -254,9 +254,10 @@ class CommandOSAKill : public Command { class ListCallback : public NumberList { + CommandSource &source; ListFormatter &list; public: - ListCallback(ListFormatter &_list, const Anope::string &numstr) : NumberList(numstr, false), list(_list) + ListCallback(CommandSource &_source, ListFormatter &_list, const Anope::string &numstr) : NumberList(numstr, false), source(_source), list(_list) { } @@ -275,12 +276,12 @@ class CommandOSAKill : public Command entry["Mask"] = x->mask; entry["Creator"] = x->by; entry["Created"] = Anope::strftime(x->created, NULL, true); - entry["Expires"] = Anope::Expires(x->expires); + entry["Expires"] = Anope::Expires(x->expires, source.nc); entry["Reason"] = x->reason; this->list.AddEntry(entry); } } - nl_list(list, mask); + nl_list(source, list, mask); nl_list.Process(); } else diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 028ab9107..fa7732d33 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -92,9 +92,9 @@ class CommandOSForbid : public Command CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5), fs("ForbidService", "forbid") { this->SetDesc(_("Forbid usage of nicknames, channels, and emails")); - this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037\002 \037reason\037")); + this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037 [\037reason\037]")); this->SetSyntax(_("DEL {NICK|CHAN|EMAIL|REGISTER} \037entry\037")); - this->SetSyntax("LIST (NICK|CHAN|EMAIL|REGISTER)"); + this->SetSyntax("LIST [NICK|CHAN|EMAIL|REGISTER]"); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override @@ -275,7 +275,7 @@ class CommandOSForbid : public Command ForbidData *d = this->fs->FindForbid(entry, ftype); if (d != NULL) { - Log(LOG_ADMIN, source, this) << "to remove forbid " << d->mask << " of type " << subcommand; + Log(LOG_ADMIN, source, this) << "to remove forbid on " << d->mask << " of type " << subcommand; source.Reply(_("%s deleted from the %s forbid list."), d->mask.c_str(), subcommand.c_str()); this->fs->RemoveForbid(d); } @@ -290,7 +290,7 @@ class CommandOSForbid : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn(_("Mask")).AddColumn(_("Type")).AddColumn(_("Reason")); + list.AddColumn(_("Mask")).AddColumn(_("Type")).AddColumn(_("Creator")).AddColumn(_("Expires")).AddColumn(_("Reason")); for (unsigned i = 0; i < forbids.size(); ++i) { @@ -312,7 +312,7 @@ class CommandOSForbid : public Command entry["Mask"] = d->mask; entry["Type"] = stype; entry["Creator"] = d->creator; - entry["Expires"] = d->expires ? Anope::strftime(d->expires, source.GetAccount()).c_str() : "never"; + entry["Expires"] = d->expires ? Anope::strftime(d->expires, NULL, true).c_str() : Language::Translate(source.GetAccount(), _("Never")); entry["Reason"] = d->reason; list.AddEntry(entry); } @@ -467,7 +467,7 @@ class OSForbid : public Module d = this->forbidService.FindForbid(params[1], FT_EMAIL); if (d != NULL) { - source.Reply("Your email address is not allowed, choose a different one."); + source.Reply(_("Your email address is not allowed, choose a different one.")); return EVENT_STOP; } } @@ -476,7 +476,7 @@ class OSForbid : public Module ForbidData *d = this->forbidService.FindForbid(params[0], FT_EMAIL); if (d != NULL) { - source.Reply("Your email address is not allowed, choose a different one."); + source.Reply(_("Your email address is not allowed, choose a different one.")); return EVENT_STOP; } } diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index 4b549d2ed..22d426fda 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -218,7 +218,7 @@ class CommandOSIgnore : public Command entry["Mask"] = ignore.mask; entry["Creator"] = ignore.creator; entry["Reason"] = ignore.reason; - entry["Expires"] = Anope::strftime(ignore.time, source.GetAccount()); + entry["Expires"] = Anope::Expires(ignore.time, source.GetAccount()); list.AddEntry(entry); } @@ -266,7 +266,7 @@ class CommandOSIgnore : public Command CommandOSIgnore(Module *creator) : Command(creator, "operserv/ignore", 1, 4) { this->SetDesc(_("Modify the Services ignore list")); - this->SetSyntax(_("ADD \037time\037 {\037nick\037|\037mask\037} [\037reason\037]")); + this->SetSyntax(_("ADD \037expiry\037 {\037nick\037|\037mask\037} [\037reason\037]")); this->SetSyntax(_("DEL {\037nick\037|\037mask\037}")); this->SetSyntax("LIST"); this->SetSyntax("CLEAR"); diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index e12777d02..8fb4cc4f7 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -121,7 +121,7 @@ class NewsBase : public Command ListFormatter::ListEntry entry; entry["Number"] = stringify(i + 1); entry["Creator"] = list[i]->who; - entry["Created"] = Anope::strftime(list[i]->time, source.GetAccount()); + entry["Created"] = Anope::strftime(list[i]->time, NULL, true); entry["Text"] = list[i]->text; lflist.AddEntry(entry); } diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index b969e9b67..7c460b286 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -118,9 +118,10 @@ class CommandOSSXLineBase : public Command class SXLineListCallback : public NumberList { XLineManager *xlm; + CommandSource &source; ListFormatter &list; public: - SXLineListCallback(XLineManager *x, ListFormatter &_list, const Anope::string &numlist) : NumberList(numlist, false), xlm(x), list(_list) + SXLineListCallback(XLineManager *x, CommandSource &_source, ListFormatter &_list, const Anope::string &numlist) : NumberList(numlist, false), xlm(x), source(_source), list(_list) { } @@ -139,12 +140,12 @@ class CommandOSSXLineBase : public Command entry["Mask"] = x->mask; entry["By"] = x->by; entry["Created"] = Anope::strftime(x->created, NULL, true); - entry["Expires"] = Anope::Expires(x->expires); + entry["Expires"] = Anope::Expires(x->expires, source.nc); entry["Reason"] = x->reason; list.AddEntry(entry); } } - sl_list(this->xlm(), list, mask); + sl_list(this->xlm(), source, list, mask); sl_list.Process(); } else |