started the process of adding minimuf, translated the minimuf subroutines
[spider.git] / perl / DXMsg.pm
index 5ab8d4af5dbc60804707884f9001f15fd714283f..d5f56c330a59945e944ad9b0a608bea0d0d65c7e 100644 (file)
@@ -186,6 +186,13 @@ sub process
                        $busy{$f[2]} = $ref; # set interlock
                        $self->send(DXProt::pc30($f[2], $f[1], $stream)); # send ack
                        $ref->{lastt} = $main::systime;
+
+                       # look to see whether this is a non private message sent to a known callsign
+                       my $uref = DXUser->get_current($ref->{to});
+                       if (iscallsign($ref->{to}) && !$ref->{private} && $uref && $uref->homenode) {
+                               $ref->{private} = 1;
+                               dbg('msg', "set bull to $ref->{to} to private");
+                       }
                        last SWITCH;
                }
                
@@ -260,7 +267,7 @@ sub process
                                                # does an identical message already exist?
                                                my $m;
                                                for $m (@msg) {
-                                                       if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from}) {
+                                                       if ($ref->{subject} eq $m->{subject} && $ref->{t} == $m->{t} && $ref->{from} eq $m->{from} && $ref->{to} eq $m->{to}) {
                                                                $ref->stop_msg($self->call);
                                                                my $msgno = $m->{msgno};
                                                                dbg('msg', "duplicate message to $msgno\n");
@@ -386,9 +393,9 @@ sub store
        my $lines = shift;
        
        # we only proceed if there are actually any lines in the file
-       if (!$lines || @{$lines} == 0) {
-               return;
-       }
+#      if (!$lines || @{$lines} == 0) {
+#              return;
+#      }
        
        if ($ref->{file}) {                     # a file
                dbg('msg', "To be stored in $ref->{to}\n");
@@ -581,7 +588,7 @@ sub queue_msg
 
                # ignore 'delayed' messages until their waiting time has expired
                if (exists $ref->{waitt}) {
-                       next if $ref->{waitt} < $main::systime;
+                       next if $ref->{waitt} > $main::systime;
                        delete $ref->{waitt};
                }