From b5e09d7c8431dac8f1c6a56e41b899b80e3bba90 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 10 May 2010 18:19:11 +0000 Subject: [PATCH] Notes: Add some missing returns When deleting a note via /#- or listening the available notes via /#?, the code somehow managed to add a note. Also, this fixes checking for empty notes. Found by tomaw, thanks. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1978 726aef4b-f618-498e-8847-2d620e286838 --- modules/notes.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/notes.cpp b/modules/notes.cpp index 6bfbd1d8..806fcb05 100644 --- a/modules/notes.cpp +++ b/modules/notes.cpp @@ -45,6 +45,7 @@ public: if (sLine == "#?") { ListNotes(true); + return HALT; } else if (sLine.Left(2) == "#-") { sKey = sLine.Token(0).LeftChomp_n(2); if (DelNote(sKey)) { @@ -52,6 +53,7 @@ public: } else { PutModNotice("Unable to delete note [" + sKey + "]"); } + return HALT; } else if (sLine.Left(2) == "#+") { sKey = sLine.Token(0).LeftChomp_n(2); bOverwrite = true; @@ -62,7 +64,7 @@ public: CString sValue(sLine.Token(1, true)); if (!sKey.empty()) { - if (!bOverwrite && !GetNV(sKey).empty()) { + if (!bOverwrite && FindNV(sKey) != EndNV()) { PutModNotice("That note already exists. Use /#+ to overwrite."); } else if (AddNote(sKey, sValue)) { if (!bOverwrite) {