From fa7ed12aad28d6bd1b3d1b0190a3bccae1e1c832 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 16 Apr 2025 03:00:52 +0100 Subject: Use a duration string when telling people to wait before emailing. --- src/mail.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mail.cpp') diff --git a/src/mail.cpp b/src/mail.cpp index 3aa15c99f..cb2b53bbe 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -93,7 +93,10 @@ bool Mail::Send(User *u, NickCore *nc, BotInfo *service, const Anope::string &su if (!b.Get("usemail") || b.Get("sendfrom").empty()) u->SendMessage(service, _("Services have been configured to not send mail.")); else if (Anope::CurTime - u->lastmail < b.Get("delay")) - u->SendMessage(service, _("Please wait \002%lu\002 seconds and retry."), (unsigned long)b.Get("delay") - (Anope::CurTime - u->lastmail)); + { + const auto delay = b.Get("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 -- cgit