Add IM module for talk, chat and announces
[spider.git] / perl / DXXml / IM.pm
1 #
2 # XML IM handler (Chat, Announces, Talk)
3 #
4 # $Id$
5 #
6 # Copyright (c) Dirk Koopman, G1TLH
7 #
8
9 use strict;
10
11 package DXXml::IM;
12
13 use DXDebug;
14 use DXProt;
15 use IsoTime;
16 use Investigate;
17 use Time::HiRes qw(gettimeofday tv_interval);
18
19 use vars qw($VERSION $BRANCH @ISA %pings);
20 $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
21 $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/  || (0,0));
22 $main::build += $VERSION;
23 $main::branch += $BRANCH;
24
25 @ISA = qw(DXXml);
26
27 #
28 # This is the general purpose IM sentence
29 #
30 # It is of the form: <chat [to=<user call>|<node call>|<chat group>] ...>the text</chat>
31 #
32 # This covers:
33 #
34 #     announce/full        (no to=)
35 #     announce/local       (to="$mycall")
36 #     announce/<node call> (to="<node call>")
37 #     chat <group>         (to="<group>")
38 #     talk <user call>     (to="<user call>")
39
40
41 sub handle_input
42 {
43         my $self = shift;
44         my $dxchan = shift;
45         
46         if ($self->{to} eq $main::mycall) {
47
48         } else {
49                 $self->route($dxchan);
50         }
51 }
52
53 sub topcxx
54 {
55         my $self = shift;
56         unless (exists $self->{'-pcxx'}) {
57                 if (my $to = $self->{to}) {
58                         if (Route::Node::get($to)) {
59                                 
60                         }
61                 }
62                 $self->{'-pcxx'} = DXProt::pc51($self->{to}, $self->{o}, $self->{s});
63         }
64         return $self->{'-pcxx'};
65 }
66
67 1;