Initialize unresolved states
This commit is contained in:
parent
549b863493
commit
9705b59226
10
rowbot
10
rowbot
|
@ -334,10 +334,10 @@ state_resolve() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if [[ -v config["$1"] ]]; then
|
||||
ns_config["$1"]=${config["$1"]}
|
||||
if [[ -v config[$1] ]]; then
|
||||
ns_config[$1]=${config[$1]}
|
||||
elif [[ -v DEFAULT ]]; then
|
||||
ns_config["$1"]=$DEFAULT
|
||||
ns_config[$1]=$DEFAULT
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
@ -345,10 +345,11 @@ state_resolve() {
|
|||
|
||||
state_put() {
|
||||
local ns=${NS-global}
|
||||
declare -gA __rowbot_state_store_"$ns"
|
||||
# The `ns_config` variable is a reference to an array
|
||||
# shellcheck disable=SC2178
|
||||
declare -n ns_config=__rowbot_state_store_"$ns"
|
||||
ns_config["$1"]=$2
|
||||
ns_config[$1]=$2
|
||||
}
|
||||
|
||||
state_get() {
|
||||
|
@ -743,7 +744,6 @@ on_msg_354_privmagic() {
|
|||
}
|
||||
|
||||
on_msg_396_privmagic() {
|
||||
config[host]=${msg_args[1]}
|
||||
NS=irc state_put host "${msg_args[1]}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue