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 6fd8460df07ddb82f0de33439db88177d2dc53c2 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Mon, 18 Jul 2011 04:19:40 +0100 Subject: changed format reset to format delete for chansetup_footer, to properly restore it if unset to begin with --- feature-tests/getchan.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature-tests/getchan.pl b/feature-tests/getchan.pl index 7d4ee55..acb1748 100644 --- a/feature-tests/getchan.pl +++ b/feature-tests/getchan.pl @@ -104,7 +104,7 @@ sub restore_formats { Irssi::command("^FORMAT chansetup_line $line_format"); Irssi::command("^FORMAT chansetup_header $head_format"); if ($foot_format =~ m/^\s*$/) { - Irssi::command("^FORMAT -reset chansetup_footer"); + Irssi::command("^FORMAT -delete chansetup_footer"); } else { Irssi::command("^FORMAT chansetup_footer $foot_format"); } -- 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 From 205dfaa87262a343c608a02fcc75b09914c51464 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Wed, 20 Jul 2011 09:38:54 +0100 Subject: add additional check to avoid crash if URI doesn't have a 'host' method. --- longify/longify-urls.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/longify/longify-urls.pl b/longify/longify-urls.pl index 38e8ba8..cd36503 100644 --- a/longify/longify-urls.pl +++ b/longify/longify-urls.pl @@ -130,7 +130,12 @@ sub _handle_messages { my $uri_obj = URI->new($url); - return unless ref($uri_obj) && exists $domains->{$uri_obj->host}; + # check we've got a valid url + return unless ref($uri_obj); + return unless $uri_obj->can('host'); + + # match against the whitelist. + return unless exists $domains->{$uri_obj->host}; $pending_msg_params->{$url} = [@_]; $lookup_in_progress = 1; -- cgit v1.2.3 From cb347e7214d5b525afde804f762e1d911ec50070 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 24 Jul 2011 19:02:26 +0100 Subject: fixes bug in notifyquit uberprompt autoload --- quit-notify/notifyquit.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quit-notify/notifyquit.pl b/quit-notify/notifyquit.pl index 3958a39..1e5032b 100644 --- a/quit-notify/notifyquit.pl +++ b/quit-notify/notifyquit.pl @@ -141,7 +141,7 @@ if (script_is_loaded('uberprompt')) { } sub load_uberprompt_failed { - Irssi::signal_remove('script error', 'load_prompt_failed'); + Irssi::signal_remove('script error', 'load_uberprompt_failed'); print "Script could not be loaded. Script cannot continue. " . "Check you have uberprompt.pl installed in your scripts directory and " -- cgit v1.2.3 From 87416ffba178e8cccaa62e4437061edccb739377 Mon Sep 17 00:00:00 2001 From: Tom Feist Date: Sun, 24 Jul 2011 19:13:05 +0100 Subject: fixed incorrect signal removal (leading to irssi-crashing loop) in documentation for uberprompt --- prompt_info/README.pod | 2 +- prompt_info/uberprompt.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prompt_info/README.pod b/prompt_info/README.pod index d8e3b3e..70dd0b5 100644 --- a/prompt_info/README.pod +++ b/prompt_info/README.pod @@ -211,7 +211,7 @@ I<---- start of snippet ----> } sub load_uberprompt_failed { - Irssi::signal_remove('script error', 'load_prompt_failed'); + Irssi::signal_remove('script error', 'load_uberprompt_failed'); print "Script could not be loaded. Script cannot continue. " . "Check you have uberprompt.pl installed in your path and " diff --git a/prompt_info/uberprompt.pl b/prompt_info/uberprompt.pl index 62bda13..cd64707 100644 --- a/prompt_info/uberprompt.pl +++ b/prompt_info/uberprompt.pl @@ -211,7 +211,7 @@ I<---- start of snippet ----> } sub load_uberprompt_failed { - Irssi::signal_remove('script error', 'load_prompt_failed'); + Irssi::signal_remove('script error', 'load_uberprompt_failed'); print "Script could not be loaded. Script cannot continue. " . "Check you have uberprompt.pl installed in your path and " -- cgit v1.2.3 From 214e1ef87d22e4368c3e2604b29621ecfcef5b29 Mon Sep 17 00:00:00 2001 From: richo Date: Mon, 1 Aug 2011 11:17:38 +1000 Subject: Updated docs --- auto-server/auto_server.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index ac0cd29..f5a26dd 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -5,8 +5,8 @@ # # the primary command used is /join+ #channelname # -# Mappings for channels to servers is accomplished with the -# joinplus_server_maps setting. +# Mappings for channels and servers are retrieved from irssi's internal +# /channel list # # Within this setting, space separated pairs denote channel, server pairs. # Spaces also separate individual pairs, for example: @@ -17,9 +17,9 @@ # will connect you, and then join that channel. # TODO: -# Autocompletion for channel names # address conflict resolution # fix that disgusting race condition +# Fix incredibly slow shutdown time after a few days use strict; use warnings; -- cgit v1.2.3 From 82b9876de12f14b04e8926b7f8b66b01b79da5c2 Mon Sep 17 00:00:00 2001 From: shabble Date: Mon, 15 Aug 2011 13:41:24 +0100 Subject: added simple demo of input masking for password entry. --- feature-tests/hide_password.pl | 125 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 feature-tests/hide_password.pl diff --git a/feature-tests/hide_password.pl b/feature-tests/hide_password.pl new file mode 100644 index 0000000..2fe01fc --- /dev/null +++ b/feature-tests/hide_password.pl @@ -0,0 +1,125 @@ +=pod + +=head1 NAME + +hide_password.pl + +=head1 DESCRIPTION + +A minimalist template useful for basing actual scripts on. + +=head1 INSTALLATION + +Copy into your F<~/.irssi/scripts/> directory and load with +C>. + +=head1 USAGE + +None, since it doesn't actually do anything. + +=head1 AUTHORS + +Copyright E 2011 Tom Feist Cshabble+irssi@metavore.orgE> + +=head1 LICENCE + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +=head1 BUGS + +=head1 TODO + +Use this template to make an actual script. + +=cut + +use strict; +use warnings; + +use Irssi; +use Irssi::Irc; +use Irssi::TextUI; + +use Data::Dumper; + +our $VERSION = '0.1'; +our %IRSSI = ( + authors => 'shabble', + contact => 'shabble+irssi@metavore.org', + name => '', + description => '', + license => 'MIT', + updated => '$DATE' + ); + + +my $password_active; +my $password_buffer; + +sub PASSWORD_CHAR () { ord('#') } + +sub init { + Irssi::command_bind('password', \&cmd_password); + $password_active = 0; + $password_buffer = ''; + +} + +sub cmd_password { + # Hmm, broken. + #Irssi::gui_input_set('Password: '); + begin_entry_redirect(); +} + +sub begin_entry_redirect { + $password_active = 1; + $password_buffer = ''; + + Irssi::signal_add_first('gui key pressed', 'sig_key_pressed'); + +} + +sub end_entry_redirect { + Irssi::signal_remove('gui key pressed', 'sig_key_pressed'); + $password_active = 0; +} + +sub password_complete { + Irssi::active_win->command("/echo Your password is: $password_buffer"); + Irssi::gui_input_set(''); +} + +sub sig_key_pressed { + my ($key) = @_; + + return unless $password_active; + + my $char = chr $key; + if ($char =~ m/\r|\n/) { + end_entry_redirect(); + password_complete(); + Irssi::signal_stop; + } else { + # TODO: Test if the char is printable, and abort otherwise? + $password_buffer .= $char; + Irssi::signal_continue(PASSWORD_CHAR); + } +} + +init(); -- cgit v1.2.3 From f3f4d3bd4fb76aea0bb60247dfa8b8efff06d52c Mon Sep 17 00:00:00 2001 From: shabble Date: Mon, 15 Aug 2011 13:47:48 +0100 Subject: added a delay to the /password function to make the input change show up. --- feature-tests/hide_password.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/feature-tests/hide_password.pl b/feature-tests/hide_password.pl index 2fe01fc..695a985 100644 --- a/feature-tests/hide_password.pl +++ b/feature-tests/hide_password.pl @@ -82,9 +82,13 @@ sub init { } sub cmd_password { - # Hmm, broken. - #Irssi::gui_input_set('Password: '); - begin_entry_redirect(); + + # not sure why this delay is needed, but otherwise + # setting the input (" Password: ") doesn't work. + Irssi::timeout_add_once(10, sub { + Irssi::gui_input_set('Password: '); + begin_entry_redirect(); + }, 0); } sub begin_entry_redirect { -- cgit v1.2.3 From 211aee49554e5c6691f00000f5e8bad8db6c49f3 Mon Sep 17 00:00:00 2001 From: richo Date: Wed, 21 Sep 2011 07:31:08 +1000 Subject: Remove deprecated docs --- auto-server/auto_server.pl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/auto-server/auto_server.pl b/auto-server/auto_server.pl index f5a26dd..8676726 100644 --- a/auto-server/auto_server.pl +++ b/auto-server/auto_server.pl @@ -8,11 +8,6 @@ # Mappings for channels and servers are retrieved from irssi's internal # /channel list # -# Within this setting, space separated pairs denote channel, server pairs. -# Spaces also separate individual pairs, for example: -# -# /set joinplus_server_maps #foo Freenode #bar irc.somewhere.tld #meep DALNet -# # Then use /join+ #foo, and if you are not already connected to freenode, it # will connect you, and then join that channel. -- cgit v1.2.3