38 my %sn; # temporary 39 $sn{chanserv} = "ChanServ"; # temporary 40 41 my $_name = $sn{chanserv}; 42 my($_source,$_data) = (shift,shift); 43 44 $_data = &_cs_parse_raw_cmd($_data) if $_data; 45 &_sendit($_name,$_source,$_data); 46 47 # ************************************************************ 48 # sub routines 49 # ************************************************************ 50 51 # *** 52 # _send_it(): simple wrapper for chanserv to send data 53 # through the main socket. 54 # *** 55 56 sub _sendit 57 { 58 my $_channel = shift; 59 my $_message = shift; 60 61 # send_data(':%s ! %s :%s', $_name, $_channel, "I saw your message: $_message"); 62 printf(":%s ! %s :%s\n", $_name, $_channel, "I saw your message: $_message"); 63 } 64 65 66 # *** 67 # _cs_parse_raw_cmd() : parses out raw data from main destined 68 # for chanserv. This will parse the raw packet. 69 # *** 70 71 sub _cs_parse_raw_cmd 72 { 73 my ($cmd) = @_ ; 74 75 # Chanserv :test 76 # ChanServ@Services.Netfrag.Com :test 77 78 my ($_to_whom, 79 $_message) = split(/:/,$cmd); 80 81 # First, make sure that we are the right one getting called 82 unless ( /\#/ ) { 83 if ( lc($_to_whom) !~ m/$_name/i ) { 84 &sendit($_source,"Please let an admin know that something is broke."); 85 } 86 } 87 88 return($_message); 89 } 90 91 1;