From 64b89a7f492048c5495723a825c98942a02b07c7 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Wed, 30 Mar 2011 19:48:26 +0100 Subject: [PATCH] Update old znc config to work with the new identfile module --- znc.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/znc.cpp b/znc.cpp index c8a9297b..d5390d06 100644 --- a/znc.cpp +++ b/znc.cpp @@ -1541,6 +1541,35 @@ bool CZNC::DoRehash(CString& sError) msModules[sModName] = sArgs; continue; + // Convert old-style ISpoofFormat's and ISpoofFile to identfile module + } else if (sName.Equals("ISpoofFormat") || sName.Equals("ISpoofFile")) { + CModule *pIdentFileMod = GetModules().FindModule("identfile"); + if (!pIdentFileMod) { + CUtils::PrintAction("Loading Global Module [identfile]"); + + CString sModRet; + bool bModRet = GetModules().LoadModule("identfile", "", NULL, sModRet); + + if (bModRet) { + sModRet = sModRet.Token(1, true, "identfile] "); + } + + CUtils::PrintStatus(bModRet, sModRet); + if (!bModRet) { + sError = sModRet; + return false; + } + + pIdentFileMod = GetModules().FindModule("identfile"); + msModules["identfile"] = ""; + } + + if (!pIdentFileMod->SetNV(sName.TrimPrefix_n("ISpoof"), sValue)) { + sError = "Failed to convert " + sName + " to the identfile module"; + CUtils::PrintError(sError); + return false; + } + continue; } else if (sName.Equals("MOTD")) { AddMotd(sValue); continue;