mirror of
git://scm.dxcluster.org/scm/spider
synced 2024-09-21 07:47:10 +00:00
tidied up the talk thing a bit more
This commit is contained in:
parent
4b1dd2cb84
commit
87ebd761d9
1
Changes
1
Changes
@ -6,6 +6,7 @@
|
||||
5. fix talkmode so that it only does 'via' PC10s when it really needs to.
|
||||
6. SEND now displays a message if you try to do it in not prompt mode.
|
||||
7. stopped a few more things being done by rcmd (eg send, talk, ann, dx)
|
||||
8. tidied up the talking a bit more.
|
||||
29Jul00=======================================================================
|
||||
1. added forward/latlong which will forward ALL the users that have a latitude
|
||||
and longitude set on them to one or more locally connected nodes - with a hop
|
||||
|
@ -180,10 +180,7 @@ sub normal
|
||||
} 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};
|
||||
@ -194,24 +191,7 @@ sub normal
|
||||
} 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+)/;
|
||||
$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, $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 {
|
||||
@ -226,6 +206,30 @@ sub normal
|
||||
$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;
|
||||
|
Loading…
Reference in New Issue
Block a user