$self->{logininfo} = $user->wantlogininfo;
$self->{here} = 1;
+ # get the filters
+ $self->{spotsfilter} = Filter::read_in('spots', $call, 0) || Filter::read_in('spots', 'user_default', 0);
+ $self->{wwvfilter} = Filter::read_in('wwv', $call, 0) || Filter::read_in('wwv', 'user_default', 0);
+ $self->{wcyfilter} = Filter::read_in('wcy', $call, 0) || Filter::read_in('wcy', 'user_default', 0);
+ $self->{annfilter} = Filter::read_in('ann', $call, 0) || Filter::read_in('ann', 'user_default', 0) ;
+
# clean up qra locators
my $qra = $user->qra;
$qra = undef if ($qra && !DXBearing::is_qra($qra));
} elsif ($self->{state} eq 'talk') {
if ($cmdline =~ m{^(?:/EX|/ABORT)}i) {
for (@{$self->{talklist}}) {
- my $ent = $_;
- my ($to, $via) = $ent =~ /(\S+)>(\S+)/;
- my $dxchan = DXChannel->get($via);
- $dxchan->talk($self->{call}, $to, $via, $self->msg('talkend')) if $dxchan;
+ $self->send_talks($_, $self->msg('talkend'));
}
$self->state('prompt');
delete $self->{talklist};
} elsif ($self->{talklist} && @{$self->{talklist}}) {
# send what has been said to whoever is in this person's talk list
for (@{$self->{talklist}}) {
- my $ent = $_;
- my ($to, $via) = $ent =~ /(\S+)>(\S+)/;
- my $dxchan = DXChannel->get($via);
- if ($dxchan && DXCluster->get_exact($to)) {
- $dxchan->talk($self->{call}, $to, $via, $cmdline);
- } else {
- $self->send($self->msg('disc2', $via ? $via : $to));
- my @l = grep { $_ ne $ent } @{$self->{talklist}};
- if (@l) {
- $self->{talklist} = \@l;
- } else {
- delete $self->{talklist};
- $self->state('prompt');
- }
- }
+ $self->send_talks($_, $cmdline);
}
$self->send($self->talk_prompt) if $self->{state} eq 'talk';
} else {
$self->prompt() if $self->{state} =~ /^prompt/o;
}
+# send out the talk messages taking into account vias and connectivity
+sub send_talks
+{
+ my ($self, $ent, $line) = @_;
+
+ my ($to, $via) = $ent =~ /(\S+)>(\S+)/;
+ $to = $ent unless $to;
+ my $call = $via ? $via : $to;
+ my $clref = DXCluster->get_exact($call);
+ my $dxchan = $clref->dxchan if $clref;
+ if ($dxchan) {
+ $dxchan->talk($self->{call}, $to, $via, $line);
+ } else {
+ $self->send($self->msg('disc2', $via ? $via : $to));
+ my @l = grep { $_ ne $ent } @{$self->{talklist}};
+ if (@l) {
+ $self->{talklist} = \@l;
+ } else {
+ delete $self->{talklist};
+ $self->state('prompt');
+ }
+ }
+}
+
sub talk_prompt
{
my $self = shift;
my @call;
for (@{$self->{talklist}}) {
my ($to, $via) = /(\S+)>(\S+)/;
+ $to = $_ unless $to;
push @call, $to;
}
return $self->msg('talkprompt', join(',', @call));
$line =~ s/\s+$//o; # why am having to do this?
$self->send($line);
}
- $self->{pagedata} = \@_;
+ $self->{pagedata} = [ @_ ];
$self->state('page');
$self->send($self->msg('page', scalar @_));
} else {
sleep(1);
}
- if ($call eq $main::myalias) { # unset the channel if it is us really
- my $node = DXNode->get($main::mycall);
- $node->{dxchan} = 0;
- }
+# if ($call eq $main::myalias) { # unset the channel if it is us really
+# my $node = DXNode->get($main::mycall);
+# $node->{dxchan} = 0;
+# }
# issue a pc17 to everybody interested
my $nchan = DXChannel->get($main::mycall);
{
my ($self, $from, $to, $via, $line) = @_;
$line =~ s/\\5E/\^/g;
- $self->send("$to de $from $line") if $self->{talk};
+ $self->send("$to de $from: $line") if $self->{talk};
Log('talk', $to, $from, $main::mycall, $line);
}