From: Ralf Ertzinger Date: Fri, 3 May 2013 18:54:57 +0000 (+0200) Subject: libvideosite: Switch to display mode, if /nosave is given in the message X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=commitdiff_plain;h=88757bf7a37a953e33c37721eb086789a5e5e169 libvideosite: Switch to display mode, if /nosave is given in the message --- 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'),