summaryrefslogtreecommitdiffstats
path: root/debian/patches/go.pl-multiple-networks.diff
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/go.pl-multiple-networks.diff')
-rw-r--r--debian/patches/go.pl-multiple-networks.diff65
1 files changed, 65 insertions, 0 deletions
diff --git a/debian/patches/go.pl-multiple-networks.diff b/debian/patches/go.pl-multiple-networks.diff
new file mode 100644
index 0000000..5db19c6
--- /dev/null
+++ b/debian/patches/go.pl-multiple-networks.diff
@@ -0,0 +1,65 @@
+Description: show network name if there're channels with the same name on different networks
+Forwarded: not-needed
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476518
+Author: Ryan Niebur <ryanryan52@gmail.com>
+Last-Update: 2017-07-12
+--- a/scripts/go.pl
++++ b/scripts/go.pl
+@@ -48,6 +48,48 @@
+ return $re;
+ }
+
++sub generate_the_list {
++ my $foo = {};
++ foreach(Irssi::windows) {
++ $foo->{get_channel_name($_)} ||= 0;
++ $foo->{get_channel_name($_)} += 1;
++ }
++ return $foo;
++}
++
++sub get_server_tag {
++ my $w = shift;
++ if(defined($w->items()) && defined($w->items()->{server}) && defined($w->items()->{server}->{tag})) {
++ return $w->items()->{server}->{tag};
++ } else {
++ return "";
++ }
++}
++
++sub get_channel_name {
++ my $w = shift;
++ return $w->get_active_name();
++}
++
++sub get_channel_and_tag {
++ my $w = shift;
++ if(length(get_server_tag($w)) > 0) {
++ return get_channel_name($w) . '@' . get_server_tag($w);
++ } else {
++ return get_channel_name($w); # dunno how to handle this correctly...hopefully it will never come up.
++ }
++}
++
++sub name_of_this_window {
++ my $w = shift;
++ my $list = generate_the_list();
++ if($list->{get_channel_name($w)} > 1){
++ return get_channel_and_tag($w);
++ } else {
++ return get_channel_name($w);
++ }
++}
++
+ sub signal_complete_go {
+ my ($complist, $window, $word, $linestart, $want_space) = @_;
+ my $channel = $window->get_active_name();
+@@ -60,7 +102,7 @@
+ Irssi::settings_get_bool('go_complete_anchored'));
+ @$complist = ();
+ foreach my $w (Irssi::windows) {
+- my $name = $w->get_active_name();
++ my $name = name_of_this_window($w);
+ if ($word ne "") {
+ if ($name =~ $re) {
+ push(@$complist, $name)