summaryrefslogtreecommitdiff
path: root/modules/memoserv/ms_send.cpp
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2024-11-13 11:44:03 +0000
committerSadie Powell <sadie@witchery.services>2024-11-13 11:56:11 +0000
commit4de59d61d8f593c18630b46270f48e32e4549ec0 (patch)
treeabcf20ef9bb1d6940c1e026bd628ff9b823c39fa /modules/memoserv/ms_send.cpp
parent0dc65cc162a8a87b1a3f66555d9fe328df004899 (diff)
Use durations instead of seconds in waiting messages.
Diffstat (limited to 'modules/memoserv/ms_send.cpp')
-rw-r--r--modules/memoserv/ms_send.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/memoserv/ms_send.cpp b/modules/memoserv/ms_send.cpp
index 6805bde7b..85e9acffc 100644
--- a/modules/memoserv/ms_send.cpp
+++ b/modules/memoserv/ms_send.cpp
@@ -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());
}