1
0
mirror of https://github.com/anope/anope.git synced 2026-06-30 10:16:38 +02:00

Use a duration string when telling people to wait before emailing.

This commit is contained in:
Sadie Powell
2025-04-16 03:00:52 +01:00
parent 94c20f3084
commit fa7ed12aad
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -93,7 +93,10 @@ bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &su
if (!b.Get<bool>("usemail") || b.Get<const Anope::string>("sendfrom").empty())
u->SendMessage(service, _("Services have been configured to not send mail."));
else if (Anope::CurTime - u->lastmail < b.Get<time_t>("delay"))
u->SendMessage(service, _("Please wait \002%lu\002 seconds and retry."), (unsigned long)b.Get<time_t>("delay") - (Anope::CurTime - u->lastmail));
{
const auto delay = b.Get<time_t>("delay") - (Anope::CurTime - u->lastmail);
u->SendMessage(service, _("Please wait \002%s\002 and retry."), Anope::Duration(delay, u->Account()).c_str());
}
else if (nc->email.empty())
u->SendMessage(service, _("Email for \002%s\002 is invalid."), nc->display.c_str());
else