slug the not here messages so they can't loopback
authorminima <minima>
Wed, 27 Jun 2001 11:49:46 +0000 (11:49 +0000)
committerminima <minima>
Wed, 27 Jun 2001 11:49:46 +0000 (11:49 +0000)
Changes
perl/DXCommandmode.pm

diff --git a/Changes b/Changes
index fe4156cda47a89616dedfc5c8b3d595e9b15f126..4c5287680902b606e58455b848268d769c44ce9b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 27Jun01=======================================================================
 1. try adding an ARC mail hack
+2. slug the not here messages so they can't loopback
 25Jun01=======================================================================
 1. added automatic 'not here' message
 21Jun01=======================================================================
index c7ce8c3c7f6699e8313740a7d95afd4766ba6eaa..cfedb1db07768c4f89d829753bf31cb236afbb93 100644 (file)
@@ -32,7 +32,7 @@ use Sun;
 use Internet;
 
 use strict;
-use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors);
+use vars qw(%Cache %cmd_cache $errstr %aliases $scriptbase $maxerrors %nothereslug);
 
 %Cache = ();                                   # cache of dynamically loaded routine's mod times
 %cmd_cache = ();                               # cache of short names
@@ -393,6 +393,12 @@ sub process
                        $dxchan->t($t);
                }
        }
+
+       while (my ($k, $v) = each %nothereslug) {
+               if ($main::systime >= $v + 300) {
+                       delete $nothereslug{$k};
+               }
+       }
 }
 
 #
@@ -646,11 +652,15 @@ sub talk
        Log('talk', $to, $from, $main::mycall, $line);
        # send a 'not here' message if required
        unless ($self->{here} && $from ne $to) {
-               my ($ref, $dxchan);
-               if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) {
-                       my $name = $self->user->name || $to;
-                       my $s = $self->user->nothere || $dxchan->msg('nothere', $name);
-                       $dxchan->talk($to, $from, undef, $s);
+               my $key = "$to$from";
+               unless (exists $nothereslug{$key}) {
+                       my ($ref, $dxchan);
+                       if (($ref = Route::get($from)) && ($dxchan = $ref->dxchan)) {
+                               my $name = $self->user->name || $to;
+                               my $s = $self->user->nothere || $dxchan->msg('nothere', $name);
+                               $nothereslug{$key} = $main::systime;
+                               $dxchan->talk($to, $from, undef, $s);
+                       }
                }
        }
 }