From: <ps...@us...> - 2010-05-10 18:19:18
|
Revision: 1978 http://znc.svn.sourceforge.net/znc/?rev=1978&view=rev Author: psychon Date: 2010-05-10 18:19:11 +0000 (Mon, 10 May 2010) Log Message: ----------- Notes: Add some missing returns When deleting a note via /#-<key> 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. Modified Paths: -------------- trunk/modules/notes.cpp Modified: trunk/modules/notes.cpp =================================================================== --- trunk/modules/notes.cpp 2010-05-10 17:45:15 UTC (rev 1977) +++ trunk/modules/notes.cpp 2010-05-10 18:19:11 UTC (rev 1978) @@ -45,6 +45,7 @@ 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 @@ } 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 @@ 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 /#+<key> <note> to overwrite."); } else if (AddNote(sKey, sValue)) { if (!bOverwrite) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |