- $self->{pagedata} = \@ans;
- $self->state('page');
- $self->send($self->msg('page', scalar @ans));
- } else {
- for (@ans) {
- $self->send($_) if $_;
+ $self->state('prompt');
+ delete $self->{talklist};
+ } elsif ($cmdline =~ m(^/\w+)) {
+ $cmdline =~ s(^/)();
+ $self->send_ans(run_cmd($self, $cmdline));
+ $self->send($self->talk_prompt);
+ } 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');
+ }
+ }