From 7572c8e6a6bae4877ae228764ab1e993f996f9ce Mon Sep 17 00:00:00 2001 From: psychon Date: Sat, 1 Mar 2008 09:44:09 +0000 Subject: [PATCH] autoop: Add a define for the challenge length git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@973 726aef4b-f618-498e-8847-2d620e286838 --- modules/autoop.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/autoop.cpp b/modules/autoop.cpp index ac154155..f5d8020a 100644 --- a/modules/autoop.cpp +++ b/modules/autoop.cpp @@ -11,6 +11,8 @@ class CAutoOpMod; +#define AUTOOP_CHALLENGE_LENGTH 32 + class CAutoOpTimer : public CTimer { public: @@ -431,7 +433,7 @@ public: return false; } - if (sChallenge.length() != 32) { + if (sChallenge.length() != AUTOOP_CHALLENGE_LENGTH) { PutModule("WARNING! [" + Nick.GetHostMask() + "] sent an invalid challenge."); return false; } @@ -487,7 +489,7 @@ public: // Now issue challenges for the new users in the queue for (MCString::iterator it = m_msQueue.begin(); it != m_msQueue.end(); it++) { - it->second = CString::RandomString(32); + it->second = CString::RandomString(AUTOOP_CHALLENGE_LENGTH); PutIRC("NOTICE " + it->first + " :!ZNCAO CHALLENGE " + it->second); } }