diff options
author | Farow <farow_spam@lavabit.com> | 2013-10-02 17:47:56 +0300 |
---|---|---|
committer | Eustachy Kapusta <Eustachy.kapusta@gmail.com> | 2013-10-07 22:58:38 +0200 |
commit | 075cc61c942998b7fdfeabfde10490ef233f88cd (patch) | |
tree | 00d3c95ac10ab8b5d3ff325d977860545e9ad661 /plugins/perl/lib/Xchat/List/Network/AutoJoin.pm | |
parent | aafbb6374b903d0c8ec5364f4cb3f2065cc7d31e (diff) |
Rebrand Perl plugin to HexChat,
Add /pl and plugin_pref Add help messages
Diffstat (limited to 'plugins/perl/lib/Xchat/List/Network/AutoJoin.pm')
-rw-r--r-- | plugins/perl/lib/Xchat/List/Network/AutoJoin.pm | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/plugins/perl/lib/Xchat/List/Network/AutoJoin.pm b/plugins/perl/lib/Xchat/List/Network/AutoJoin.pm deleted file mode 100644 index 8b4e40d2..00000000 --- a/plugins/perl/lib/Xchat/List/Network/AutoJoin.pm +++ /dev/null @@ -1,80 +0,0 @@ -package Xchat::List::Network::AutoJoin; -use strict; -use warnings; - -use overload -# '%{}' => \&as_hash, -# '@{}' => \&as_array, - '""' => 'as_string', - '0+' => 'as_bool'; - -sub new { - my $class = shift; - - my @autojoins; - - return bless \@autojoins, $class; -} - -sub add { - my $self = shift; - - my $line = shift; - - my ( $channel, $key ) = split /,/, $line, 2; - $key = $key || ''; - - push @$self, { - channel => $channel, - key => $key, - }; -} - -sub channels { - my $self = shift; - - if( wantarray ) { - return map { $_->{channel} } @$self; - } else { - return scalar @$self; - } -} - -sub keys { - my $self = shift; - return map { $_->{key} } @$self ; - -} - -sub pairs { - my $self = shift; - - my @channels = $self->channels; - my @keys = $self->keys; - - my @pairs = map { $_ => shift @keys } @channels; -} - -sub as_hash { - my $self = shift; - return +{ $self->pairs }; -} - -sub as_string { - my $self = shift; - return join " ", - join( ",", $self->channels ), - join( ",", $self->keys ); -} - -sub as_array { - my $self = shift; - return [ map { \%$_ } @$self ]; -} - -sub as_bool { - my $self = shift; - return $self->channels ? 1 : ""; -} - -1 |