summary refs log tree commit diff stats
path: root/plugins/perl/lib/Xchat/List/Network/Entry.pm
diff options
context:
space:
mode:
authorFarow <farow_spam@lavabit.com>2013-10-02 17:47:56 +0300
committerEustachy Kapusta <Eustachy.kapusta@gmail.com>2013-10-07 22:58:38 +0200
commit075cc61c942998b7fdfeabfde10490ef233f88cd (patch)
tree00d3c95ac10ab8b5d3ff325d977860545e9ad661 /plugins/perl/lib/Xchat/List/Network/Entry.pm
parentaafbb6374b903d0c8ec5364f4cb3f2065cc7d31e (diff)
Rebrand Perl plugin to HexChat,
Add /pl and plugin_pref

Add help messages
Diffstat (limited to 'plugins/perl/lib/Xchat/List/Network/Entry.pm')
-rw-r--r--plugins/perl/lib/Xchat/List/Network/Entry.pm106
1 files changed, 0 insertions, 106 deletions
diff --git a/plugins/perl/lib/Xchat/List/Network/Entry.pm b/plugins/perl/lib/Xchat/List/Network/Entry.pm
deleted file mode 100644
index 6f2aa925..00000000
--- a/plugins/perl/lib/Xchat/List/Network/Entry.pm
+++ /dev/null
@@ -1,106 +0,0 @@
-package Xchat::List::Network::Entry;
-use strict;
-use warnings;
-
-my %key_for = (
-	I => "irc_nick1",
-	i => "irc_nick2",
-	U => "irc_user_name",
-	R => "irc_real_name",
-	P => "server_password",
-	B => "nickserv_password",
-	N => "network",
-	D => "selected",
-	E => "encoding",
-);
-my $letter_key_re = join "|", keys %key_for;
-
-sub parse {
-	my $data  = shift;
-	my $entry = {
-		irc_nick1       => undef,
-		irc_nick2       => undef,
-		irc_user_name   => undef,
-		irc_real_name   => undef,
-		server_password => undef,
-
-		# the order of the channels need to be maintained
-		# list of { channel => .., key => ... }
-		autojoins         => Xchat::List::Network::AutoJoin->new( '' ),
-		connect_commands   => [],
-		flags             => {},
-		selected          => undef,
-		encoding          => undef,
-		servers           => [],
-		nickserv_password => undef,
-		network           => undef,
-	};
-
-	my @fields = split /\n/, $data;
-	chomp @fields;
-
-	$entry->{ autojoins } = Xchat::List::Network::AutoJoin->new();
-
-	for my $field ( @fields ) {
-	SWITCH: for ( $field ) {
-			/^($letter_key_re)=(.*)/ && do {
-				$entry->{ $key_for{ $1 } } = $2;
-				last SWITCH;
-			};
-
-			/^J.(.*)/ && do {
-				$entry->{ autojoins }->add( $1 );
-			};
-
-			/^F.(.*)/ && do {
-				$entry->{ flags } = parse_flags( $1 );
-			};
-
-			/^S.(.+)/ && do {
-				push @{$entry->{servers}}, parse_server( $1 );
-			};
-
-			/^C.(.+)/ && do {
-				push @{$entry->{connect_commands}}, $1;
-			};
-		}
-	}
-
-#	$entry->{ autojoins } = $entry->{ autojoin_channels };
-	return $entry;
-}
-
-sub parse_flags {
-	my $value = shift || 0;
-	my %flags;
-
-	$flags{ "cycle" }         = $value & 1  ? 1 : 0;
-	$flags{ "use_global" }    = $value & 2  ? 1 : 0;
-	$flags{ "use_ssl" }       = $value & 4  ? 1 : 0;
-	$flags{ "autoconnect" }   = $value & 8  ? 1 : 0;
-	$flags{ "use_proxy" }     = $value & 16 ? 1 : 0;
-	$flags{ "allow_invalid" } = $value & 32 ? 1 : 0;
-
-	return \%flags;
-}
-
-sub parse_server {
-	my $data = shift;
-	if( $data ) {
-		my ($host, $port) = split /\//, $data;
-		unless( $port ) {
-			my @parts = split /:/, $host;
-
-			# if more than 2 then we are probably dealing with a IPv6 address
-			# if less than 2 then no port was specified
-			if( @parts == 2 ) {
-				$port = $parts[1];
-			}
-		}
-
-		$port ||= 6667;
-		return { host => $host, port => $port };
-	}
-}
-
-1