From e15479d9231bad168ac318aa2cbb43c705bc547c Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Wed, 13 Jul 2011 21:53:34 +0400 Subject: fix https urls shortening --- tinyurl-tabcomplete/complete-tiny-url.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyurl-tabcomplete/complete-tiny-url.pl b/tinyurl-tabcomplete/complete-tiny-url.pl index b2d448f..45a00c0 100644 --- a/tinyurl-tabcomplete/complete-tiny-url.pl +++ b/tinyurl-tabcomplete/complete-tiny-url.pl @@ -123,7 +123,7 @@ sub match_uri { if ($text =~ $regex) { my $uri = $1; # shorten needs the http prefix or it'll treat it as a relative link. - $uri = 'http://' . $uri if $uri !~ m(http://); + $uri = 'http://' . $uri if $uri !~ m(https?://); return $uri; } else { # no match -- cgit v1.2.3 From 1b722bb1eac9c3a568de6f203ecd2277d1c1fd6b Mon Sep 17 00:00:00 2001 From: Artem Savkov Date: Thu, 14 Jul 2011 11:48:39 +0400 Subject: shortening support for protocols other than http(s) --- tinyurl-tabcomplete/complete-tiny-url.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinyurl-tabcomplete/complete-tiny-url.pl b/tinyurl-tabcomplete/complete-tiny-url.pl index 45a00c0..ad43c5e 100644 --- a/tinyurl-tabcomplete/complete-tiny-url.pl +++ b/tinyurl-tabcomplete/complete-tiny-url.pl @@ -123,7 +123,7 @@ sub match_uri { if ($text =~ $regex) { my $uri = $1; # shorten needs the http prefix or it'll treat it as a relative link. - $uri = 'http://' . $uri if $uri !~ m(https?://); + $uri = 'http://' . $uri if $uri !~ m([a-z][\w-]+:(?:/{1,3}|[a-z0-9%])); return $uri; } else { # no match -- cgit v1.2.3 From 0ddd64b6e0405af84a95e5e5fce9d0840fa74da5 Mon Sep 17 00:00:00 2001 From: richo Date: Mon, 18 Jul 2011 12:52:26 +1000 Subject: Retrieve channel data before attempting to work out channel list --- auto-server/auto_server.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index 447a131..3d10272 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -104,8 +104,8 @@ sub haxy_print_hook { sub parse_channel_map { #my $data = Irssi::settings_get_str('joinplus_server_maps'); - unbind_completion(); my $data = retrieve_channels(); + unbind_completion(); my @items = split /\s+/, $data; if (@items % 2 == 0) { $channel_map = { @items }; # risky? -- cgit v1.2.3 From 598a08d34b56796e5673292df2ab1632002ac1a7 Mon Sep 17 00:00:00 2001 From: richo Date: Mon, 18 Jul 2011 12:54:36 +1000 Subject: Only attempt join if channel exists --- auto-server/auto_server.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index 3d10272..c409e5d 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -209,13 +209,14 @@ sub do_channel_join { my $channel = $pending_joins->{$serv->{address}}; $channel = $pending_joins->{$serv->{tag}} unless $channel; + if ($channel) { + _debug_print ("attempting to join $channel"); - _debug_print ("attempting to join $channel"); + Irssi::server_find_tag($serv->{tag})->command("JOIN $channel"); - Irssi::server_find_tag($serv->{tag})->command("JOIN $channel"); - - delete $pending_joins->{$serv->{address}}; - delete $pending_joins->{$serv->{tag}}; + delete $pending_joins->{$serv->{address}}; + delete $pending_joins->{$serv->{tag}}; + } } -- cgit v1.2.3 From 3c37b460cb63c35f2ef7733bd06c0fe4533a912c Mon Sep 17 00:00:00 2001 From: richo Date: Mon, 18 Jul 2011 13:37:38 +1000 Subject: Recognise other channel prefixes and characters --- auto-server/auto_server.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index c409e5d..780763b 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -94,7 +94,7 @@ sub haxy_print_hook { my $data = $_[1]; # Hose control characters $data =~ s/\x04.//g; - if ($data =~ m/^#/) { + if ($data =~ m/^[#&!]/) { my @items = split /\s+/, $data; push(@hack_channels, $items[0]); push(@hack_channels, $items[1]); @@ -135,7 +135,7 @@ sub join_plus { # parse out channel name from args: my $channel; - if ($args =~ m/^(#?[#a-zA-Z0-9-]+)/) { + if ($args =~ m/^([#&!]?[^ ]+)/) { $channel = $1; _debug_print ("Channel is: $channel"); } -- cgit v1.2.3 From 09e42871973ea59b68787b14af6685f30fd750ad Mon Sep 17 00:00:00 2001 From: richo Date: Mon, 18 Jul 2011 13:39:15 +1000 Subject: at least on some networks, just a prefix is valid --- auto-server/auto_server.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index 780763b..ac0cd29 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -135,7 +135,7 @@ sub join_plus { # parse out channel name from args: my $channel; - if ($args =~ m/^([#&!]?[^ ]+)/) { + if ($args =~ m/^([#&!]?[^ ]*)/) { $channel = $1; _debug_print ("Channel is: $channel"); } -- cgit v1.2.3