X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=lib%2FOnis%2FData%2FCore.pm;h=7bc3ed924beb04f9bd4ca8c8f723e7fa86174d5c;hb=915f48ccb78a125d1e160de11b3dd9b035a55ccd;hp=d1e3fefafb4a5254c81d8959592d9c11f240a261;hpb=a079fa409a73daae8465928b8855268a40c9b17c;p=onis.git diff --git a/lib/Onis/Data/Core.pm b/lib/Onis/Data/Core.pm index d1e3fef..7bc3ed9 100644 --- a/lib/Onis/Data/Core.pm +++ b/lib/Onis/Data/Core.pm @@ -16,7 +16,7 @@ use warnings; use Exporter; use Onis::Config qw(get_config); -use Onis::Users qw(ident_to_name); +use Onis::Users qw(chatter_to_name); use Onis::Data::Persistent; use Onis::Parser::Persistent qw(get_absolute_time); @@ -43,7 +43,9 @@ our $ChannelNames = Onis::Data::Persistent->new ('ChannelNames', 'channel', 'cou qw( store unsharp calculate_nicks - get_all_nicks get_channel get_main_nick nick_to_ident ident_to_nick nick_to_name + get_all_nicks get_channel get_main_nick + nick_to_ident ident_to_nick + nick_to_name ident_to_name get_total_lines get_most_recent_time nick_rename print_output register_plugin ); @Onis::Data::Core::ISA = ('Exporter'); @@ -378,7 +380,6 @@ sub calculate_nicks { my $chatter = $_; my ($nick, $ident) = split (m/!/, $chatter); - my $name = ident_to_name ($ident); my ($counter) = $ChatterList->get ($chatter); $nicks->{$nick}{$ident} = 0 unless (defined ($nicks->{$nick}{$ident})); @@ -396,8 +397,10 @@ sub calculate_nicks for (keys %{$nicks->{$this_nick}}) { my $ident = $_; - my $name = ident_to_name ($ident); + my $name = chatter_to_name ("$this_nick!$ident"); my $num = $nicks->{$this_nick}{$ident}; + + next if ($name eq 'ignore'); $this_total += $num; @@ -659,8 +662,7 @@ sub ident_to_nick =item I<$name> = B (I<$nick>) -Return the name associated with I<$nick>. This function uses B -(see L). +Return the name associated with I<$nick>. =cut @@ -671,7 +673,28 @@ sub nick_to_name if ($ident) { - return (ident_to_name ($ident)); + return (chatter_to_name ("$nick!$ident")); + } + else + { + return (''); + } +} + +=item I<$name> = B (I<$ident>) + +Returns the name associated with I<$ident>. + +=cut + +sub ident_to_name +{ + my $ident = shift; + my $nick = ident_to_nick ($ident); + + if ($nick) + { + return (chatter_to_name ("$nick!$ident")); } else { @@ -736,8 +759,9 @@ Print the output. Should be called only once.. sub print_output { - # FIXME FIXME FIXME - if (!get_total_lines ()) + my ($total, $this) = get_total_lines (); + + if (!$total) { print STDERR <<'MESSAGE';