projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
1. Do some range checking for spots and WWV in the future (got a WWV for Oct
[spider.git]
/
perl
/
DXMsg.pm
diff --git
a/perl/DXMsg.pm
b/perl/DXMsg.pm
index 262a4155c92cd4deab28b8f832cec1ac8e519cf4..4a81a585616318756a0832a539815c442d3e3bea 100644
(file)
--- a/
perl/DXMsg.pm
+++ b/
perl/DXMsg.pm
@@
-5,7
+5,12
@@
# Copyright (c) 1998 Dirk Koopman G1TLH
#
# $Id$
# Copyright (c) 1998 Dirk Koopman G1TLH
#
# $Id$
-#
+#
+#
+# Notes for implementors:-
+#
+# PC28 field 11 is the RR required flag
+# PC28 field 12 is a VIA routing (ie it is a node call)
package DXMsg;
package DXMsg;
@@
-196,7
+201,7
@@
sub process
$ref->store($ref->{lines});
add_dir($ref);
my $dxchan = DXChannel->get($ref->{to});
$ref->store($ref->{lines});
add_dir($ref);
my $dxchan = DXChannel->get($ref->{to});
- $dxchan->
send("New mail has arrived for you"
) if $dxchan;
+ $dxchan->
msg('msgnew'
) if $dxchan;
Log('msg', "Message $ref->{msgno} from $ref->{from} received from $f[2] for $ref->{to}");
}
}
Log('msg', "Message $ref->{msgno} from $ref->{from} received from $f[2] for $ref->{to}");
}
}
@@
-492,6
+497,11
@@
sub queue_msg
if ($ref->{private}) {
if ($ref->{'read'} == 0) {
$clref = DXCluster->get_exact($ref->{to});
if ($ref->{private}) {
if ($ref->{'read'} == 0) {
$clref = DXCluster->get_exact($ref->{to});
+ unless ($clref) { # otherwise look for a homenode
+ my $uref = DXUser->get($ref->{to});
+ my $hnode = $uref->homenode if $uref;
+ $clref = DXCluster->get_exact($hnode) if $hnode;
+ }
if ($clref && !grep { $clref->{dxchan} == $_ } DXCommandmode::get_all) {
$dxchan = $clref->{dxchan};
$ref->start_msg($dxchan) if $clref && !get_busy($dxchan->call) && $dxchan->state eq 'normal';
if ($clref && !grep { $clref->{dxchan} == $_ } DXCommandmode::get_all) {
$dxchan = $clref->{dxchan};
$ref->start_msg($dxchan) if $clref && !get_busy($dxchan->call) && $dxchan->state eq 'normal';
@@
-519,6
+529,21
@@
sub queue_msg
}
}
}
}
+# is there a message for me?
+sub for_me
+{
+ my $call = uc shift;
+ my $ref;
+
+ foreach $ref (@msg) {
+ # is it for me, private and unread?
+ if ($ref->{to} eq $call && $ref->{private}) {
+ return 1 if !$ref->{'read'};
+ }
+ }
+ return 0;
+}
+
# start the message off on its travels with a PC28
sub start_msg
{
# start the message off on its travels with a PC28
sub start_msg
{
@@
-717,9
+742,9
@@
sub do_send_stuff
delete $loc->{lines};
delete $loc->{to};
delete $self->{loc};
delete $loc->{lines};
delete $loc->{to};
delete $self->{loc};
- $self->state('prompt');
$self->func(undef);
DXMsg::queue_msg(0);
$self->func(undef);
DXMsg::queue_msg(0);
+ $self->state('prompt');
} elsif ($line eq "\031" || uc $line eq "/ABORT" || uc $line eq "/QUIT") {
#push @out, $self->msg('sendabort');
push @out, "aborted";
} elsif ($line eq "\031" || uc $line eq "/ABORT" || uc $line eq "/QUIT") {
#push @out, $self->msg('sendabort');
push @out, "aborted";