mirror of https://github.com/SeanOMik/znc-push.git
Implemented APPEND command for modifying config values
This commit is contained in:
parent
d4fd3ce741
commit
f2de10139c
|
@ -69,6 +69,11 @@ Commands
|
||||||
|
|
||||||
Allows you to modify configuration values.
|
Allows you to modify configuration values.
|
||||||
|
|
||||||
|
* `append <option> <value>`
|
||||||
|
|
||||||
|
Allows you to add a string to end of a configuration value. Automatically adds a
|
||||||
|
space to separate the appended value from the existing value.
|
||||||
|
|
||||||
* `get [<option>]`
|
* `get [<option>]`
|
||||||
|
|
||||||
Allows you to see current configuration values.
|
Allows you to see current configuration values.
|
||||||
|
|
27
notifo.cpp
27
notifo.cpp
|
@ -547,6 +547,33 @@ class CNotifoMod : public CModule
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
options[option] = value;
|
options[option] = value;
|
||||||
|
options[option].Trim();
|
||||||
|
SetNV(option, value);
|
||||||
|
|
||||||
|
authencode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// APPEND command
|
||||||
|
else if (action == "append")
|
||||||
|
{
|
||||||
|
if (token_count < 3)
|
||||||
|
{
|
||||||
|
PutModule("Usage: append <option> <value>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CString option = tokens[1].AsLower();
|
||||||
|
CString value = command.Token(2, true, " ");
|
||||||
|
MCString::iterator pos = options.find(option);
|
||||||
|
|
||||||
|
if (pos == options.end())
|
||||||
|
{
|
||||||
|
PutModule("Error: invalid option name");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
options[option] += " " + value;
|
||||||
|
options[option].Trim();
|
||||||
SetNV(option, value);
|
SetNV(option, value);
|
||||||
|
|
||||||
authencode();
|
authencode();
|
||||||
|
|
Loading…
Reference in New Issue