# Try to find old config files and load them.
if (-r $conffile) {
+ Irssi::print("Converting configuration from videosite.json. This will happen only once.");
eval {
local $/;
open(CONF, '<', $conffile);
close(CONF);
};
} elsif (-r $xmlconffile) {
+ Irssi::print("Converting configuration from videosite.xml. This will happen only once.");
$conf = XML::Simple::XMLin($xmlconffile, ForceArray => ['config', 'option', 'connectorlist'], KeepRoot => 1, KeyAttr => {'connector' => '+name', 'config' => 'module', 'option' => 'key'});
+ } else {
+ # No old config files around. Just exit.
+ return;
}
#
# Copy the "basic" settings.
foreach (qw(getter mode)) {
- config_set(['getter'], $conf->{videosite}->{$_});
+ config_set([$_], $conf->{videosite}->{$_});
}
# Copy the per-getter/setter settings
}
}
}
- config_set(['active-connectors'], join(",", @{$conf->{connectorlist}}));
+ config_set(['active-connectors'], join(",", @{$conf->{videosite}->{connectorlist}}));
config_set(['defined-connectors'], join(",", @connectors));
config_set(['config-version'], '2');
}