1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 19:43:13 +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 -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());
}