libvideosite: Switch to display mode, if /nosave is given in the message
authorRalf Ertzinger <ralf@skytale.net>
Fri, 3 May 2013 18:54:57 +0000 (20:54 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Fri, 3 May 2013 18:54:57 +0000 (20:54 +0200)
libvideosite.pm

index 3dfe1c3..bc41e5c 100644 (file)
@@ -992,11 +992,15 @@ sub check_for_link {
     my $m;
     my $p;
     my $skip;
+    my $mode = _config_get(['mode']);
 
 
-    # Look if we should ignore this line
+    #
+    # If /nosave is present in the message switch to display mode, regardless
+    # of config setting
+    #
     if ($message =~ m,(?:\s|^)/nosave(?:\s|$),) {
-        return;
+        $mode = 'display';
     }
 
     _push_output($event->{ewpf});
@@ -1014,7 +1018,7 @@ sub check_for_link {
                 $skip = $remote_api->{link_callback}->($m);
             }
             unless($skip) {
-                if ('download' eq _config_get(['mode'])) {
+                if ('download' eq $mode) {
                     _io(
                         sprintf('%s>>> %sSaving %s%%s%s %s%%s',
                             _colorpair('*red'),
@@ -1029,7 +1033,7 @@ sub check_for_link {
                     unless($getter->get($m)) {
                         _io(sprintf('%s>>> FAILED', _colorpair('*red')));
                     }
-                } elsif ('display' eq _config_get(['mode'])) {
+                } elsif ('display' eq $mode) {
                     _io(
                         sprintf('%s>>> %sSaw %s%%s%s %s%%s',
                             _colorpair('*magenta'),