$name = lc($name);
+ unless($name =~ m|^[a-z]+$|) {
+ _io("%s is not a valid connector name (only letters are allowed)", $name);
+ return;
+ }
+
if (_config_list_has(['defined-connectors'], $name)) {
_io("Connector already exists");
return;
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});
$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'),
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'),