added some of uri's utility actions for build script
[urisagit/Stem.git] / lib / Stem / ChatLabel.pm
CommitLineData
4536f655 1package Stem::ChatLabel ;
2
3use strict ;
4
5
6my $attr_spec = [
7
8 {
9 'name' => 'sw_addr',
10 'help' => <<HELP,
11This is the address of the chat switch
12HELP
13 },
14] ;
15
16sub new {
17
18 my( $class ) = shift ;
19
20 my $self = Stem::Class::parse_args( $attr_spec, @_ ) ;
21 return $self unless ref $self ;
22
23 return $self ;
24}
25
26sub data_in {
27
28 my ( $self, $msg ) = @_ ;
29
30 my $data = $msg->data() ;
31
32#print "$$data" ;
33
34 substr( $$data, 0, 0, $msg->from_cell() . ': ' ) ;
35
36 $msg->data( $data ) ;
37 $msg->to_cell( $self->{'sw_addr'} ) ;
38
39 $msg->dispatch() ;
40}
41
421 ;