fix find
authorminima <minima>
Tue, 8 Mar 2005 00:21:19 +0000 (00:21 +0000)
committerminima <minima>
Tue, 8 Mar 2005 00:21:19 +0000 (00:21 +0000)
perl/DXProt.pm
perl/Thingy/Ping.pm

index 78c39f1635639091235e15a9b78b79e9172b6485..7972bc3bf83f6ba7baa677ed29ebac82e7fd0fb1 100644 (file)
@@ -1541,7 +1541,7 @@ sub handle_51
        my $line = shift;
        my $origin = shift;
 
-       if (eph_dup($line)) {
+       if (eph_dup($line, 60)) {
                dbg("PCPROT: dup PC51 detected") if isdbg('chanerr');
                return;
        }
index 39a4ee78d2a8036353b8c4b471d59b4a6abb6674..30359a422e7b6b89e22fef22c9a074d51a96a29c 100644 (file)
@@ -99,7 +99,7 @@ sub handle
 
                        # it's a reply, look in the ping list for this one
                        my $ref = $ping{$thing->{id}} if exists $thing->{id};
-                       $ref ||= $thing->find;
+                       $ref ||= find($thing->{origin}, $thing->{group});
                        if ($ref) {
                                my $t = tv_interval($ref->{t}, [ gettimeofday ]);
                                if (my $dxc = DXChannel::get($ref->{user} || $ref->{origin})) {
@@ -179,10 +179,17 @@ sub forget
 
 sub find
 {
-       my $call = shift;
+       my $to = shift;
+       my $from = shift;
+       my $user = shift;
+       
        foreach my $thing (values %ping) {
-               if (($thing->{user} || $thing->{origin}) eq $call) {
-                       return $thing;
+               if ($thing->{origin} eq $from && $thing->{group} eq $to) {
+                       if ($user) {
+                               return if $thing->{user} && $thing->{user} eq $user; 
+                       } else {
+                               return $thing;
+                       }
                }
        }
        return undef;