qw(
store unsharp calculate_nicks
- get_all_nicks get_channel get_main_nick nick_to_ident ident_to_nick
+ get_all_nicks get_channel get_main_nick nick_to_ident ident_to_nick nick_to_name
get_total_lines nick_rename print_output register_plugin
);
@Onis::Data::Core::ISA = ('Exporter');
for ($ChatterList->keys ())
{
- my $chatter = shift;
+ my $chatter = $_;
my ($nick, $ident) = split (m/!/, $chatter);
my $name = ident_to_name ($ident);
my ($counter) = $ChatterList->get ($chatter);
}
}
+=item I<$name> = B<nick_to_name> (I<$nick>)
+
+Return the name associated with I<$nick>. This function uses B<ident_to_name>
+(see L<Onis::Users>).
+
+=cut
+
+sub nick_to_name
+{
+ my $nick = shift;
+ my $ident = nick_to_ident ($nick);
+
+ if ($ident)
+ {
+ return (ident_to_name ($ident));
+ }
+ else
+ {
+ return ('');
+ }
+}
+
=item I<$lines> = B<get_total_lines> ()
Returns the total number of lines parsed so far.
sub print_output
{
- if (!get_total_lines ())
+ # FIXME FIXME FIXME
+ if (!get_total_lines () and 0)
{
print STDERR <<'MESSAGE';
if ($::DEBUG & 0x0200)
{
- print STDOUT $/, __FILE__, ': GET(', $obj->{'id'}, ', ', $key, ') = (' . join (', ', @{$obj->{'fields'}}) . ')';
+ print STDOUT $/, __FILE__, ': GET(', $obj->{'id'}, ', ', $key, ') = (' . join (', ', @{$obj->{'data'}{$key}}) . ')';
}
return (@{$obj->{'data'}{$key}});
use Onis::Html (qw(get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(get_main_nick register_plugin));
+use Onis::Data::Core (qw(get_main_nick register_plugin nick_to_name));
use Onis::Data::Persistent ();
-use Onis::Users (qw(nick_to_name));
use Onis::Plugins::Core (qw(get_core_nick_counters));
@Onis::Plugins::Bignumbers::EXPORT_OK = (qw(get_bignumbers));
use Onis::Config qw(get_config);
use Onis::Html qw(get_filehandle);
use Onis::Language qw(translate);
-use Onis::Data::Core qw(register_plugin get_main_nick nick_to_ident);
-use Onis::Users qw(ident_to_name);
+use Onis::Data::Core qw(register_plugin get_main_nick nick_to_ident nick_to_name);
+use Onis::Users (qw(ident_to_name));
use Onis::Data::Persistent;
our $ConversationCache = Onis::Data::Persistent->new ('ConversationCache', 'partners', qw(time0 time1 time2 time3));
$nick_from = get_main_nick ($nick_from);
$nick_to = get_main_nick ($nick_to);
- next if (!$nick_from or !$nick_to or ($nick_from eq $nick_to));
+ next if (!$nick_from or !$nick_to);
+ next if ($nick_from eq $nick_to);
- if ($ConversationData->{$nick_from}{$nick_to})
+ if (!defined ($ConversationData->{$nick_from}{$nick_to}))
{
$ConversationData->{$nick_from}{$nick_to} =
{
my @img = get_config ('horizontal_images');
+ # FIXME
my @data = get_top (10);
return (undef) unless (@data);
for (my $i = 0; $i < 4; $i++)
{
- $sum0 += $rec->{'users'}{$nick0}[$i];
- $sum1 += $rec->{'users'}{$nick1}[$i];
+ $sum0 += $rec->{'nicks'}{$nick0}[$i];
+ $sum1 += $rec->{'nicks'}{$nick1}[$i];
}
$max_num = $sum0 if ($max_num < $sum0);
# $most_lines
for (keys %$NickData)
{
- my $nick = shift;
+ my $nick = $_;
for (my $i = 0; $i < 24; $i++)
{
sub bar
{
my $max_num = shift;
-
my $source = shift;
- confess unless (ref ($source eq 'ARRAY'));
+ confess () unless (ref ($source) eq 'ARRAY');
# BAR_WIDTH is a least 10
my $max_width = $BAR_WIDTH - 4;
use Onis::Config (qw(get_config));
use Onis::Html (qw(html_escape get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(register_plugin));
+use Onis::Data::Core (qw(register_plugin get_main_nick nick_to_name));
use Onis::Data::Persistent;
-use Onis::Users (qw(nick_to_name));
@Onis::Plugins::Interestingnumbers::EXPORT_OK = (qw(get_interestingnumbers));
@Onis::Plugins::Interestingnumbers::ISA = ('Exporter');
$soliloquies) = $InterestingNumbersCache->get ($nick);
my $main = get_main_nick ($nick);
- die unless ($main);
+ next unless ($main);
if (!defined ($InterestingNumbersData->{$main}))
{
use strict;
use warnings;
+use Onis::Config (qw(get_config));
use Onis::Html (qw(get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(register_plugin nick_to_ident));
+use Onis::Data::Core (qw(register_plugin get_main_nick nick_to_ident nick_to_name));
use Onis::Data::Persistent ();
-use Onis::Users (qw(nick_to_name));
register_plugin ('TEXT', \&add);
register_plugin ('ACTION', \&add);
$max = $tmp if ($tmp);
}
- for ($MentionedNicksData->keys ())
+ for ($MentionedNicksCache->keys ())
{
my $nick = $_;
- my ($counter, $lastusedtime, $lastusedby) = $MentionedNicksData->get ($nick);
+ my ($counter, $lastusedtime, $lastusedby) = $MentionedNicksCache->get ($nick);
die unless (defined ($lastusedby));
$lastusedby = get_main_nick ($lastusedby);
}
@$MentionedNicksData = sort { $b->[1] <=> $a->[1] } (@data);
- splice (@$MentionedNicksData, $max);
+ splice (@$MentionedNicksData, $max) if (scalar (@$MentionedNicksData) > $max);
}
sub output
use Onis::Config (qw(get_config));
use Onis::Html (qw(html_escape get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(register_plugin));
+use Onis::Data::Core (qw(register_plugin nick_to_name));
use Onis::Data::Persistent ();
our $TopicCache = Onis::Data::Persistent->new ('TopicCache', 'time', qw(text nick));
use Onis::Config (qw(get_config));
use Onis::Html (qw(html_escape get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(register_plugin get_main_nick));
+use Onis::Data::Core (qw(register_plugin get_main_nick nick_to_name));
use Onis::Data::Persistent ();
-use Onis::Users (qw(nick_to_name));
register_plugin ('TEXT', \&add);
register_plugin ('ACTION', \&add);
}
@$URLData = sort { $b->[1] <=> $a->[1] } (@data);
- splice (@$URLData, $max);
+ splice (@$URLData, $max) if (scalar (@$URLData) > $max);
}
sub output
use Onis::Config (qw(get_config));
use Onis::Html (qw(html_escape get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(get_main_nick register_plugin));
+use Onis::Data::Core (qw(get_main_nick register_plugin nick_to_name));
use Onis::Users (qw(ident_to_name get_link get_image));
-use Onis::Plugins::Core (qw(get_core_nick_counters));
+use Onis::Plugins::Core (qw(get_core_nick_counters get_sorted_nicklist));
use Onis::Plugins::Conversations (qw(get_conversations));
use Onis::Plugins::Bignumbers (qw(get_bignumbers));
use Onis::Plugins::Interestingnumbers (qw(get_interestingnumbers));
use Onis::Config (qw(get_config));
use Onis::Html (qw(get_filehandle));
use Onis::Language (qw(translate));
-use Onis::Data::Core (qw(register_plugin get_main_nick));
+use Onis::Data::Core (qw(register_plugin get_main_nick nick_to_ident nick_to_name));
use Onis::Data::Persistent ();
-use Onis::Users (qw(nick_to_name));
register_plugin ('TEXT', \&add);
register_plugin ('ACTION', \&add);
use strict;
use warnings;
use Exporter;
-use Onis::Config qw#get_config#;
-use Onis::Data::Core qw(nick_to_ident);
-use Onis::Data::Persistent;
+use Onis::Config (qw(get_config));
+use Onis::Data::Persistent ();
@Onis::Users::EXPORT_OK =
(qw(
- ident_to_name chatter_to_name nick_to_name name_to_ident
+ ident_to_name chatter_to_name name_to_ident
get_realname get_link get_image
));
@Onis::Users::ISA = ('Exporter');
=head1 USAGE
- use Onis::Users qw#ident_to_name chatter_to_name nick_to_name get_realname get_link get_image#;
+ use Onis::Users qw#ident_to_name chatter_to_name get_realname get_link get_image#;
# Functions to query the name
$name = ident_to_name ($ident);
$name = chatter_to_name ($chatter);
- $name = nick_to_name ($nick);
# Functions to query a name's properties
my $realname = get_realname ($name);
return (ident_to_name ($ident));
}
-=item B<nick_to_name> (I<$nick>)
-
-Return the name associated with I<$nick>. This function uses B<nick_to_ident>
-(see L<Onis::Data::Core>) to convert I<$nick> to an ident and then calls
-B<ident_to_name>.
-
-=cut
-
-sub nick_to_name
-{
- my $nick = shift;
- my $ident = nick_to_ident ($nick);
-
- if ($ident)
- {
- return (ident_to_name ($ident));
- }
- else
- {
- return ('');
- }
-}
-
=item B<name_to_ident> (I<$name>)
Does the reverse of B<ident_to_name>: Returns the most recent association of
# 0x0400 Data::Core (dump incoming data to stderr)
# 0x0800 Data::Core (initializing)
# 0x1000 Onis::Users
- $::DEBUG = 0x0200;
+ $::DEBUG = 0x0000;
}
use strict;