videosite-irssi: Add messages to configuration conversion
authorRalf Ertzinger <ralf@skytale.net>
Tue, 30 Apr 2013 17:23:27 +0000 (19:23 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Tue, 30 Apr 2013 17:23:27 +0000 (19:23 +0200)
videosite-irssi.pl

index 3d72728..26ecfe5 100644 (file)
@@ -50,6 +50,7 @@ sub config_init {
 
     # Try to find old config files and load them.
     if (-r $conffile) {
 
     # 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);
         eval {
             local $/;
             open(CONF, '<', $conffile);
@@ -57,7 +58,11 @@ sub config_init {
             close(CONF);
         };
     } elsif (-r $xmlconffile) {
             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'});
         $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;
     }
 
     #
     }
 
     #