X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXCommandmode.pm;h=6fde1742b6067b8b3b1d717bfdbe073b51c5c29f;hb=0efcf0d784c8cdaf1af6ab1db5e23715e5b1476d;hp=c75f32f165a47fb80bbd0f59920dfff6be5d6937;hpb=02f97e2b119bcd216e4ce68850d48d21029fa2f5;p=spider.git diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index c75f32f1..6fde1742 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -133,23 +133,8 @@ sub start $self->{registered} = 1; } - - # decide which motd to send - my $motd; - unless ($self->{registered}) { - $motd = "${main::motd}_nor_$self->{lang}"; - $motd = "${main::motd}_nor" unless -e $motd; - } - $motd = "${main::motd}_$self->{lang}" unless $motd && -e $motd; - $motd = $main::motd unless $motd && -e $motd; - if ($self->conn->{csort} eq 'ax25') { - if ($motd) { - $motd = "${motd}_ax25" if -e "${motd}_ax25"; - } else { - $motd = "${main::motd}_ax25" if -e "${main::motd}_ax25"; - } - } - $self->send_file($motd) if -e $motd; + # send the relevant MOTD + $self->send_motd; # sort out privilege reduction $self->{priv} = 0 if $line =~ /^(ax|te)/ && !$self->conn->{usedpasswd}; @@ -1226,5 +1211,27 @@ sub print_find_reply my $sort = $flag == 2 ? "External" : "Local"; $self->send("$sort $target found at $node in $ms ms" ); } + +# send the most relevant motd +sub send_motd +{ + my $self = shift; + my $motd; + + unless ($self->{registered}) { + $motd = "${main::motd}_nor_$self->{lang}"; + $motd = "${main::motd}_nor" unless -e $motd; + } + $motd = "${main::motd}_$self->{lang}" unless $motd && -e $motd; + $motd = $main::motd unless $motd && -e $motd; + if ($self->conn->{csort} eq 'ax25') { + if ($motd) { + $motd = "${motd}_ax25" if -e "${motd}_ax25"; + } else { + $motd = "${main::motd}_ax25" if -e "${main::motd}_ax25"; + } + } + $self->send_file($motd) if -e $motd; +} 1; __END__