diff options
| author | 2016-01-13 15:59:13 -0700 | |
|---|---|---|
| committer | 2016-01-13 15:59:13 -0700 | |
| commit | 8d8447a7f936e82057143371de8fbbc9d7443b09 (patch) | |
| tree | 733735472c44d65a383e2c6b51f09c4caa2da4a9 /lib/ASM/Services.pm | |
| parent | 76fc4276b5966da13b984071b5d0b24fae09779b (diff) | |
Bugfixes and improvements
- Stop asking ChanServ to be unbanned from a channel
- Only sync channels we actually join
- Fix NickServ message detection (I wish they used numerics)
Diffstat (limited to 'lib/ASM/Services.pm')
| -rw-r--r-- | lib/ASM/Services.pm | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/lib/ASM/Services.pm b/lib/ASM/Services.pm index c64e0b1..7e1df9d 100644 --- a/lib/ASM/Services.pm +++ b/lib/ASM/Services.pm @@ -20,33 +20,26 @@ sub doServices { if ($event->{from} eq 'NickServ!NickServ@services.') { ASM::Util->dprint("NickServ: $event->{args}->[0]", 'snotice'); - if ( $::no_autojoins && $event->{args}->[0] =~ /^Please identify/ ) + if ( $::no_autojoins && ( $event->{args}->[0] =~ /^Please identify/ || $event->{args}->[0] =~ /^This nickname is registered/ ) ) { $::no_autojoins = 0; $conn->sl("NickServ identify $::settings->{nick} $::settings->{pass}" ); } elsif ( $event->{args}->[0] =~ /^You are now identified/ ) { - my @autojoins = @{$::settings->{autojoins}}; - if (defined($autojoins[30])) { - $conn->join(join(',', @autojoins[0..30])); - if (defined($autojoins[60])) { - $conn->join(join(',', @autojoins[30..60])); - $conn->join(join(',', @autojoins[60..$#autojoins])); - } else { - $conn->join(join(',', @autojoins[30..$#autojoins])); + my $joinstring = ""; + foreach my $autojoin (@{$::settings->{autojoins}}) + { + if ( length($joinstring) + length($autojoin) > 504 ) + { + $conn->join($joinstring); + $joinstring = ""; } - } else { - $conn->join(join(',', @autojoins)); + $joinstring .= ',' if length($joinstring); + $joinstring .= "$autojoin"; } + $conn->join($joinstring) if length($joinstring); $conn->sl("PING :" . time); - foreach my $chan (@autojoins[0..1]) { - ASM::Util->dprint("Syncing $chan", "sync"); - $conn->sl('who ' . $chan . ' %tcnuhra,314'); - $conn->sl('mode ' . $chan); - $conn->sl('mode ' . $chan . ' b'); - } - @::syncqueue = @autojoins[1..$#autojoins]; # $conn->schedule(2, sub { $conn->privmsg($::settings->{masterchan}, 'Now joined to all channels in '. (time - $::starttime) . " seconds."); }); } elsif ($event->{args}->[0] =~ /has been (killed|released)/ ) @@ -58,7 +51,7 @@ sub doServices { { ASM::Util->dprint('Got regain successful from nickserv!', 'snotice'); } - elsif ($event->{args}->[0] =~ /Password Incorrect/ ) + elsif ($event->{args}->[0] =~ /Invalid password/ ) { die("NickServ password invalid.") } |
