From c968d32ee2570650cd8430a9dbd5375bcfdd26b5 Mon Sep 17 00:00:00 2001 From: robbeh Date: Sat, 15 Nov 2008 16:11:40 +0000 Subject: [PATCH] applied 1.8.0s fix for the /ns resend issue git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1698 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 2 +- src/core/ns_register.c | 6 +++--- src/mail.c | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index f9221f9d7..f92e0fe5c 100644 --- a/Changes +++ b/Changes @@ -5,4 +5,4 @@ Anope Version 1.9.0 10/11 F Move core services to use BotInfo 10/12 F Move BotInfo and related methods into a class 11/01 F Move modules into a class - +11/15 F Fixed ns resending of passcode issue diff --git a/src/core/ns_register.c b/src/core/ns_register.c index a90c0ca0c..0a0e073ac 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -428,11 +428,11 @@ int do_resend(User * u) if (NSEmailReg) { if ((nr = findrequestnick(u->nick))) { if (time(NULL) < nr->lastmail + NSResendDelay) { - return MOD_CONT; - } else { - nr->lastmail = time(NULL); + notice_lang(s_NickServ, u, MAIL_LATER); + return MOD_CONT; } if (do_sendregmail(u, nr) == 0) { + nr->lastmail = time(NULL); notice_lang(s_NickServ, u, NICK_REG_RESENT, nr->email); alog("%s: re-sent registration verification code for %s to %s", s_NickServ, nr->nick, nr->email); } else { diff --git a/src/mail.c b/src/mail.c index 43d8e7845..4aa3b0a2a 100644 --- a/src/mail.c +++ b/src/mail.c @@ -30,15 +30,16 @@ MailInfo *MailRegBegin(User * u, NickRequest * nr, char *subject, char *service) { + int timeToWait = 0; if (!u || !nr || !subject || !service) { return NULL; } if (!UseMail) { notice_lang(service, u, MAIL_DISABLED); - } else if ((time(NULL) - u->lastmail < MailDelay) - || (time(NULL) - nr->lastmail < MailDelay)) { - notice_lang(service, u, MAIL_DELAYED, MailDelay); + } else if ((time(NULL) - u->lastmail < MailDelay)) { + timeToWait = MailDelay - (time(NULL) - u->lastmail); + notice_lang(service, u, MAIL_DELAYED, timeToWait); } else if (!nr->email) { notice_lang(service, u, MAIL_INVALID, nr->nick); } else {