From b0e84a0605adfe0759fc7e3ccbce2e3fff1697ec Mon Sep 17 00:00:00 2001 From: psychon Date: Sat, 17 Nov 2007 22:44:34 +0000 Subject: [PATCH] Awaynick now saves its latest setting and restores it on reload git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@877 726aef4b-f618-498e-8847-2d620e286838 --- modules/awaynick.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/awaynick.cpp b/modules/awaynick.cpp index b88d9c93..b3cb468a 100644 --- a/modules/awaynick.cpp +++ b/modules/awaynick.cpp @@ -52,12 +52,17 @@ public: MODCONSTRUCTOR(CAwayNickMod) {} virtual bool OnLoad(const CString& sArgs, CString& sMessage) { - m_sFormat = sArgs; + if (!sArgs.empty()) + m_sFormat = sArgs; + else + m_sFormat = GetNV("nick"); if (m_sFormat.empty()) { m_sFormat = "zz_%nick%"; } + SetNV("nick", m_sFormat); + return true; } @@ -111,6 +116,7 @@ public: if (!sFormat.empty()) { m_sFormat = sFormat; + SetNV("nick", m_sFormat); } if (m_pUser) {