sub sendToSocket { my( $data, $params ) = @_; if( $data eq "" ) { return 0; } if( $params->{toroom} ne "" && $params->{touser} eq "" ) { foreach my $ident( keys %clients ) { our $nick = $clients{$ident}->{nick}; if( isInIgnorelist($nick, $params->{fromuser}) && $config{ignore_modus}{$params->{kind}}==1) { }else{ my %info = loadMemberInfo($nick); if( lc $params->{toroom} eq lc $info{room}) { my $fh = $clients{$ident}->{sock}; if( defined $fh ){ my $msg = createFilter($ident, $data); $fh->syswrite($msg . "\n"); undef $fh; undef $msg; undef %info; undef $nick; } } } } }elsif( $params->{toroom} eq "" && $params->{touser} ne "" ) { my $user = $params->{touser}; my $sock = getCurrentSocket($user); my $sn= $sock->{sockname}; my $socket = $sock->{socket}; my $ident = getCurrentIdent($user); if( isInIgnorelist($clients{$sn}->{nick}, $params->{fromuser}) && $config{ignore_modus}{$params->{kind}}==1 ) { }else{ if( defined $socket ){ $msg = createFilter($ident, $data); $socket->syswrite($msg . "\n"); undef $msg; undef $ident; undef $sock; } } }elsif( $params->{touser} eq "" && $params->{toroom} eq "" ) { foreach my $ident( keys %clients ) { my $sock = $clients{$ident}->{sock}; $msg = createFilter($ident, $data); if( defined $sock ){ $sock->syswrite($msg . "\n"); } undef $msg; undef $sock; } } }