From 88757bf7a37a953e33c37721eb086789a5e5e169 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Fri, 3 May 2013 20:54:57 +0200 Subject: [PATCH] libvideosite: Switch to display mode, if /nosave is given in the message --- libvideosite.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libvideosite.pm b/libvideosite.pm index 3dfe1c3..bc41e5c 100644 --- a/libvideosite.pm +++ b/libvideosite.pm @@ -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'), -- 1.8.3.1