Permalink
Browse files

Added autosendcmd fanciness.

  • Loading branch information...
jhannah committed Jun 27, 2012
1 parent 3bed5cc commit c531c7ad0d4168f35065b84b8089324e2e8a3d3c
Showing with 52 additions and 21 deletions.
  1. +52 −21 irssi/config.pl
View
@@ -4,33 +4,57 @@
my $dir = '/home/jhannah/.irssi';
-our @servers = qw(
- perl irc.perl.org undef
- freenode irc.freenode.net undef
- acme irc.acme.com password
+our @servers = (
+ {
+ name => 'perl',
+ address => 'irc.perl.org',
+ },
+ {
+ name => 'freenode',
+ address => 'irc.freenode.net',
+ autosendcmd => "/nick deafferret; /msg nickserv identify passwordhere; wait 2000",
+ },
+ {
+ name => 'uno',
+ address => 'bioirc.ist.unomaha.edu',
+ },
+ {
+ name => 'ii',
+ address => 'gw.iinteractive.com',
+ password => 'passwordhere',
+ use_ssl => 'yes',
+ port => 6668,
+ },
+ {
+ name => 'flowdock',
+ address => 'irc.flowdock.com',
+ use_ssl => 'yes',
+ port => 6697,
+ autosendcmd => "/msg nickserv identify jay.hannah\@iinteractive.com passwordhere; wait 2000",
+ },
);
our @channels = qw(
10 #perl-help perl
- 11 #OmahaLUG freenode
- 12 #omaha.dev freenode
- 13 #omahamaker freenode
- 16 #yapcadmins perl
- 17 #mongers perl
- 18 #bioperl freenode
- 30 #acme acme
+ 11 #perl++ perl
+ 12 #uno uno
+ 13 #OmahaLUG freenode
+ 14 #omaha.dev freenode
+ 15 #omahamaker freenode
+ 16 #mongers perl
+ 17 #bioperl freenode
+ 30 #axkit-dahut perl
+ 31 #perl perl
40 #moose perl
41 #moose-dev perl
42 #kiokudb perl
43 #plack perl
- 44 #ox perl
50 #catalyst perl
51 #catalyst-dev perl
52 #tt perl
53 #poe perl
54 #dbix-class perl
55 #perl-qa perl
- 60 #axkit-dahut perl
);
@@ -39,16 +63,19 @@
{
local @servers = @servers;
print $out "servers = (\n";
- while (my ($name, $address, $password) = splice @servers, 0, 3) {
+ foreach my $s (@servers) {
+ # next unless ($s->{name} eq 'ii');
+ my $use_ssl = $s->{use_ssl} || 'no';
+ my $port = $s->{port} || '6667';
print $out <<EOT;
{
- address = '$address';
- chatnet = '$name';
- port = '6667';
- use_ssl = 'no';
+ address = '$s->{address}';
+ chatnet = '$s->{name}';
+ port = '$port';
+ use_ssl = '$use_ssl';
ssl_verify = 'no';
autoconnect = 'yes';
- password = '$password';
+ password = '$s->{password}';
},
EOT
}
@@ -59,8 +86,12 @@
{
local @servers = @servers;
print $out "chatnets = {\n";
- while (my ($name, $address, $password) = splice @servers, 0, 3) {
- print $out " $name = { type = 'IRC'; };\n";
+ foreach my $s (@servers) {
+ if ($s->{autosendcmd}) {
+ print $out " $s->{name} = { type = 'IRC'; autosendcmd = '" . $s->{autosendcmd} . "'; };\n";
+ } else {
+ print $out " $s->{name} = { type = 'IRC'; };\n";
+ }
}
print $out "};\n";
}

0 comments on commit c531c7a

Please sign in to comment.