-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a new script dont_reconnect.pl
- Loading branch information
1 parent
08e2b21
commit d0984c4
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use Irssi; | ||
use strict; | ||
use warnings; | ||
|
||
# feature nobody asked for in 25 years except Chex who thinks this should be a core feature | ||
our $VERSION = "1.0.0"; | ||
our %IRSSI = ( | ||
authors => 'terminaldweller', | ||
contact => 'https://terminaldweller.com', | ||
name => 'dont_reconnect', | ||
description => 'runs rmreconn after servers in the list disconnect', | ||
license => 'GPL3 or newer', | ||
url => 'https://github.com/irssi/scripts.irssi.org', | ||
); | ||
|
||
# dont_reconnect_list = "server1 server2 server3" | ||
Irssi::settings_add_str('misc', 'dont_reconnect_list', ''); | ||
|
||
sub run_rm_reconn { | ||
my $server_rec = @_; | ||
my $recon_list = Irssi::settings_get_str('dont_reconnect_list'); | ||
my @list = split(/ /, $recon_list); | ||
|
||
my $current_server_name = Irssi::server_name($server_rec); | ||
|
||
foreach my $server_name (@list) { | ||
if ($server_name eq $current_server_name) { | ||
Irssi::command("rmreconn"); | ||
return; | ||
} | ||
} | ||
} | ||
|
||
Irssi::signal_add('server disconnect', 'run_rm_reconn'); |