From c23f49862b7a8c377daf9205b219cb327608c4da Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Mon, 25 Jun 2007 18:04:59 +0100 Subject: [PATCH] fix announces This was caused by double duplication, in turn because I have moved to having everything done by the pc93 handler. --- Changes | 1 + cmd/announce.pl | 3 ++- cmd/chat.pl | 2 -- perl/AnnTalk.pm | 4 ++-- perl/DXProt.pm | 38 ++++++++++++++++++++++++++++---------- perl/Version.pm | 2 +- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/Changes b/Changes index 65ebd627..f0cb65b1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ 25Jun06======================================================================= 1. make sure that a C record is sent for node call every update period. +2. make announces work again (probably). 24Jun06======================================================================= 1. Fix the routing algorithms to allow route selection in the face of incomplete trees of nodes (trees as produced by sh/newc). diff --git a/cmd/announce.pl b/cmd/announce.pl index a3d3fd61..64abaad6 100644 --- a/cmd/announce.pl +++ b/cmd/announce.pl @@ -16,6 +16,7 @@ # my ($self, $line) = @_; +#$DB::single = 1; my @f = split /\s+/, $line; return (1, $self->msg('e5')) if $self->remotecmd || $self->inscript; return (1, $self->msg('e9')) if !@f; @@ -64,7 +65,7 @@ if ($drop) { return (1, ()); } -return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line); +#return (1, $self->msg('dup')) if $self->priv < 5 && AnnTalk::dup($from, $toflag, $line); Log('ann', $to, $from, $line); $main::me->normal(DXProt::pc93($to, $from, $via, $line)); diff --git a/cmd/chat.pl b/cmd/chat.pl index 874f6ac1..2aa62943 100644 --- a/cmd/chat.pl +++ b/cmd/chat.pl @@ -40,6 +40,4 @@ $text = "#$msgid $text"; $main::me->normal(DXProt::pc93($target, $from, undef, $text)); -#DXProt:):send_chat($self, 1, DXProt::pc12($from, $text, '*', $target), $from, '*', $text, $target, $main::mycall, '0'); - return (1, ()); diff --git a/perl/AnnTalk.pm b/perl/AnnTalk.pm index a38f9cb3..72abfeb2 100644 --- a/perl/AnnTalk.pm +++ b/perl/AnnTalk.pm @@ -18,7 +18,7 @@ use DXVars; use vars qw(%dup $duplth $dupage $filterdef); $duplth = 60; # the length of text to use in the deduping -$dupage = 5*24*3600; # the length of time to hold spot dups +$dupage = 5*3600; # the length of time to hold spot dups $filterdef = bless ([ # tag, sort, field, priv, special parser ['by', 'c', 0], @@ -51,7 +51,7 @@ sub dup $text = pack("C*", map {$_ & 127} unpack("C*", $text)); $text =~ s/[^\#a-zA-Z0-9]//g; $text = substr($text, 0, $duplth) if length $text > $duplth; - my $dupkey = "A$to|\L$text"; + my $dupkey = "A$call|$to|\L$text"; return DXDupe::check($dupkey, $t); } diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 18d7bdb5..61693f33 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -624,6 +624,7 @@ sub send_announce my $target = $_[6]; my $to = 'To '; my $text = unpad($_[2]); + my $from = $_[0]; if ($_[3] eq '*') { # sysops $target = "SYSOP"; @@ -640,7 +641,7 @@ sub send_announce # obtain country codes etc - my @a = Prefix::cty_data($_[0]); + my @a = Prefix::cty_data($from); my @b = Prefix::cty_data($_[4]); if ($self->{inannfilter}) { my ($filter, $hops) = @@ -653,12 +654,20 @@ sub send_announce } } - if (AnnTalk::dup($_[0], $_[1], $_[2])) { - dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr'); - return; + if (AnnTalk::dup($from, $_[1], $_[2])) { + my $dxchan = DXChannel::get($from); + if ($dxchan && $dxchan->is_user) { + if ($dxchan->priv < 5) { + $dxchan->send($dxchan->msg('dup')); + return; + } + } else { + dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr'); + return; + } } - Log('ann', $target, $_[0], $text); + Log('ann', $target, $from, $text); # send it if it isn't the except list and isn't isolated and still has a hop count # taking into account filtering and so on @@ -692,6 +701,7 @@ sub send_chat my $target = $_[3]; my $text = unpad($_[2]); my $ak1a_line; + my $from = $_[0]; # munge the group and recast the line if required if ($target =~ s/\.LST$//) { @@ -699,7 +709,7 @@ sub send_chat } # obtain country codes etc - my @a = Prefix::cty_data($_[0]); + my @a = Prefix::cty_data($from); my @b = Prefix::cty_data($_[4]); if ($self->{inannfilter}) { my ($filter, $hops) = @@ -712,13 +722,21 @@ sub send_chat } } - if (AnnTalk::dup($_[0], $_[1], $_[2], $chatdupeage)) { - dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr'); - return; + if (AnnTalk::dup($from, $target, $_[2], $chatdupeage)) { + my $dxchan = DXChannel::get($from); + if ($dxchan && $dxchan->is_user) { + if ($dxchan->priv < 5) { + $dxchan->send($dxchan->msg('dup')); + return; + } + } else { + dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr'); + return; + } } - Log('chat', $target, $_[0], $text); + Log('chat', $target, $from, $text); # send it if it isn't the except list and isn't isolated and still has a hop count # taking into account filtering and so on diff --git a/perl/Version.pm b/perl/Version.pm index af7281e0..e13cfe28 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '89'; +$build = '90'; 1; -- 2.43.0