From 73fb94c55344b6ad788c925bf13325236402891f Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 27 Aug 2010 13:44:30 -0400 Subject: Added an Anope::string::is_pos_number_only function to use everywhere we convertTo unsigned values, and fixed the mail delay error message to give the correct time. --- src/channels.cpp | 4 ++-- src/mail.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/channels.cpp b/src/channels.cpp index 65668a6d6..aa2e0affc 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -1145,7 +1145,7 @@ void do_join(const Anope::string &source, int ac, const char **av) /* Join came with a TS */ if (ac == 2) { - time_t ts = Anope::string(av[1]).is_number_only() ? convertTo(av[1]) : 0; + time_t ts = Anope::string(av[1]).is_pos_number_only() ? convertTo(av[1]) : 0; /* Their time is older, we lose */ if (chan->creation_time > ts) @@ -1309,7 +1309,7 @@ void do_topic(const Anope::string &source, int ac, const char **av) { Channel *c = findchan(av[0]); ChannelInfo *ci; - time_t topic_time = Anope::string(av[2]).is_number_only() ? convertTo(av[2]) : 0; + time_t topic_time = Anope::string(av[2]).is_pos_number_only() ? convertTo(av[2]) : 0; if (!c) { diff --git a/src/mail.cpp b/src/mail.cpp index 1cfdd6c09..354c7e2e7 100644 --- a/src/mail.cpp +++ b/src/mail.cpp @@ -40,7 +40,7 @@ bool Mail(User *u, NickRequest *nr, const Anope::string &service, const Anope::s if (!Config->UseMail) notice_lang(service, u, MAIL_DISABLED); else if (t - u->lastmail < Config->MailDelay) - notice_lang(service, u, MAIL_DELAYED, t - u->lastmail); + notice_lang(service, u, MAIL_DELAYED, Config->MailDelay - t - u->lastmail); else if (nr->email.empty()) notice_lang(service, u, MAIL_INVALID, nr->nick.c_str()); else @@ -63,7 +63,7 @@ bool Mail(User *u, NickCore *nc, const Anope::string &service, const Anope::stri if (!Config->UseMail) notice_lang(service, u, MAIL_DISABLED); else if (t - u->lastmail < Config->MailDelay) - notice_lang(service, u, MAIL_DELAYED, t - u->lastmail); + notice_lang(service, u, MAIL_DELAYED, Config->MailDelay - t - u->lastmail); else if (nc->email.empty()) notice_lang(service, u, MAIL_INVALID, nc->display.c_str()); else -- cgit