1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Use durations instead of seconds in waiting messages.

This commit is contained in:
Sadie Powell
2024-11-13 11:44:03 +00:00
parent 0dc65cc162
commit 4de59d61d8
6 changed files with 24 additions and 11 deletions
+5 -5
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Anope\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-13 02:41+0000\n"
"POT-Creation-Date: 2024-11-13 11:56+0000\n"
"PO-Revision-Date: 2024-11-13 02:45+0000\n"
"Last-Translator: Sadie Powell <sadie@witchery.services>\n"
"Language-Team: English\n"
@@ -4627,19 +4627,19 @@ msgid "Please wait %lu seconds and retry."
msgstr ""
#, c-format
msgid "Please wait %lu seconds before requesting a new vhost."
msgid "Please wait %s before requesting a new vhost."
msgstr ""
#, c-format
msgid "Please wait %lu seconds before using the %s command again."
msgid "Please wait %s before using the %s command again."
msgstr ""
#, c-format
msgid "Please wait %lu seconds before using the GROUP command again."
msgid "Please wait %s before using the GROUP command again."
msgstr ""
#, c-format
msgid "Please wait %lu seconds before using the REGISTER command again."
msgid "Please wait %s before using the REGISTER command again."
msgstr ""
#, c-format
+2 -1
View File
@@ -157,7 +157,8 @@ public:
time_t send_delay = Config->GetModule("memoserv")->Get<time_t>("senddelay");
if (Config->GetModule(this->owner)->Get<bool>("memooper") && send_delay > 0 && u && u->lastmemosend + send_delay > Anope::CurTime)
{
source.Reply(_("Please wait %lu seconds before requesting a new vhost."), (unsigned long)send_delay);
auto waitperiod = (u->lastmemosend + send_delay) - Anope::CurTime;
source.Reply(_("Please wait %s before requesting a new vhost."), Anope::Duration(waitperiod, source.GetAccount()).c_str());
u->lastmemosend = Anope::CurTime;
return;
}
+5 -1
View File
@@ -56,7 +56,11 @@ public:
if (result == MemoServService::MEMO_INVALID_TARGET)
source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str());
else if (result == MemoServService::MEMO_TOO_FAST)
source.Reply(_("Please wait %lu seconds before using the %s command again."), Config->GetModule("memoserv")->Get<unsigned long>("senddelay"), source.command.c_str());
{
auto lastmemosend = source.GetUser() ? source.GetUser()->lastmemosend : 0;
auto waitperiod = (lastmemosend + Config->GetModule("memoserv")->Get<unsigned long>("senddelay")) - Anope::CurTime;
source.Reply(_("Please wait %s before using the %s command again."), Anope::Duration(waitperiod, source.GetAccount()).c_str(), source.command.c_str());
}
else if (result == MemoServService::MEMO_TARGET_FULL)
source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str());
else
+5 -1
View File
@@ -55,7 +55,11 @@ public:
else if (result == MemoServService::MEMO_INVALID_TARGET)
source.Reply(_("\002%s\002 is not a registered unforbidden nick or channel."), nick.c_str());
else if (result == MemoServService::MEMO_TOO_FAST)
source.Reply(_("Please wait %lu seconds before using the %s command again."), Config->GetModule("memoserv")->Get<unsigned long>("senddelay"), source.command.c_str());
{
auto lastmemosend = source.GetUser() ? source.GetUser()->lastmemosend : 0;
auto waitperiod = (lastmemosend + Config->GetModule("memoserv")->Get<unsigned long>("senddelay")) - Anope::CurTime;
source.Reply(_("Please wait %s before using the %s command again."), Anope::Duration(waitperiod, source.GetAccount()).c_str(), source.command.c_str());
}
else if (result == MemoServService::MEMO_TARGET_FULL)
source.Reply(_("Sorry, %s currently has too many memos and cannot receive more."), nick.c_str());
}
+4 -1
View File
@@ -148,7 +148,10 @@ public:
if (!(target = NickAlias::Find(nick)))
source.Reply(NICK_X_NOT_REGISTERED, nick.c_str());
else if (user && Anope::CurTime < user->lastnickreg + reg_delay)
source.Reply(_("Please wait %lu seconds before using the GROUP command again."), (unsigned long)(reg_delay + user->lastnickreg) - Anope::CurTime);
{
auto waitperiod = (unsigned long)(reg_delay + user->lastnickreg) - Anope::CurTime;
source.Reply(_("Please wait %s before using the GROUP command again."), Anope::Duration(waitperiod, source.GetAccount()).c_str());
}
else if (target->nc->HasExt("NS_SUSPENDED"))
{
Log(LOG_COMMAND, source, this) << "and tried to group to SUSPENDED nick " << target->nick;
+3 -2
View File
@@ -202,8 +202,9 @@ public:
this->OnSyntaxError(source, "");
else if (u && Anope::CurTime < u->lastnickreg + reg_delay)
{
source.Reply(_("Please wait %lu seconds before using the REGISTER command again."),
(unsigned long)(u->lastnickreg + reg_delay) - Anope::CurTime);
auto waitperiod = (unsigned long)(u->lastnickreg + reg_delay) - Anope::CurTime;
source.Reply(_("Please wait %s before using the REGISTER command again."),
Anope::Duration(waitperiod, source.GetAccount()).c_str());
}
else if (NickAlias::Find(u_nick) != NULL)
source.Reply(NICK_ALREADY_REGISTERED, u_nick.c_str());