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.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1978 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2010-05-10 18:19:11 +00:00
parent e80bf15cb9
commit b5e09d7c84

View File

@@ -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 /#+<key> <note> to overwrite.");
} else if (AddNote(sKey, sValue)) {
if (!bOverwrite) {