added radio specific "motd_ax25"
[spider.git] / perl / DXCommandmode.pm
index 30ad8c560fd2b81a9ff1dad5dcc98fd8c0c68784..a00e0be808a9d19afb85db07f9f2b3da7c1b54a0 100644 (file)
@@ -65,13 +65,14 @@ sub new
        # routing, this must go out here to prevent race condx
        my $pkg = shift;
        my $call = shift;
-       my @rout = $main::routeroot->add_user($call, Route::here(1));
+#      my @rout = $main::routeroot->add_user($call, Route::here(1));
+       DXProt::_add_thingy($main::routeroot, [$call, 0, 0, 1]);
 
        # ALWAYS output the user
        my $ref = Route::User::get($call);
        if ($ref) {
                $main::me->route_pc16($main::mycall, undef, $main::routeroot, $ref);
-               $main::me->route_pc92a($main::mycall, undef, $main::routeroot, $ref);
+               $main::me->route_pc92a($main::mycall, undef, $main::routeroot, $ref) unless $DXProt::pc92_slug_changes;
        }
 
        return $self;
@@ -142,6 +143,13 @@ sub start
        }
        $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;
 
        # sort out privilege reduction
@@ -308,7 +316,7 @@ sub normal
                                if ($self->{state} eq 'talk') {
                                        $self->send_talks($_,  $self->msg('talkend'));
                                } else {
-                                       $self->send_chats($_,  $self->msg('chatend', $_));
+                                       $self->local_send('C', $self->msg('chatend', $_));
                                }
                        }
                        $self->state('prompt');
@@ -329,7 +337,7 @@ sub normal
                                                        if ($self->{state} eq 'talk') {
                                                                $self->send_talks($_, $l);
                                                        } else {
-                                                               $self->send_chats($_, $l)
+                                                               send_chats($self, $_, $l)
                                                        }
                                                }
                                        }
@@ -347,7 +355,7 @@ sub normal
                                        if ($self->{state} eq 'talk') {
                                                $self->send_talks($_, $rawline);
                                        } else {
-                                               $self->send_chats($_, $rawline);
+                                               send_chats($self, $_, $rawline);
                                        }
                                }
                        }
@@ -606,12 +614,14 @@ sub disconnect
        my $uref = Route::User::get($call);
        my @rout;
        if ($uref) {
-               @rout = $main::routeroot->del_user($uref);
+#              @rout = $main::routeroot->del_user($uref);
+               @rout = DXProt::_del_thingy($main::routeroot, [$call, 0]);
+
                dbg("B/C PC17 on $main::mycall for: $call") if isdbg('route');
 
                # issue a pc17 to everybody interested
                $main::me->route_pc17($main::mycall, undef, $main::routeroot, $uref);
-               $main::me->route_pc92d($main::mycall, undef, $main::routeroot, $uref);
+               $main::me->route_pc92d($main::mycall, undef, $main::routeroot, $uref) unless $DXProt::pc92_slug_changes;
        } else {
                confess "trying to disconnect a non existant user $call";
        }