| 1 | # $Id: Chantrack.pm,v 1.13 2000-06-30 23:52:24-04 roderick Exp $ | ||||||||||||||||||||||||||||||||
| 2 | # | ||||||||||||||||||||||||||||||||
| 3 | # Copyright (c) 1997-2000 Roderick Schertler. All rights reserved. | ||||||||||||||||||||||||||||||||
| 4 | # This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||
| 5 | # it under the same terms as Perl itself. | ||||||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||||||
| 7 | # Documentation is at the __END__. | ||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||
| 9 | # XXX | ||||||||||||||||||||||||||||||||
| 10 | # - disconnect doesn't run when changing servers, hook a connection | ||||||||||||||||||||||||||||||||
| 11 | # message additionally? | ||||||||||||||||||||||||||||||||
| 12 | # - track voice status | ||||||||||||||||||||||||||||||||
| 13 | # - sirc still outputs a message for users not on irc (code 401) | ||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||
| 17 | package Sirc::Chantrack; | ||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use Sirc::LckHash (); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use Sirc::Util qw(add_hook_type addhook arg_count_error eval_verbose ieq | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 21 | plausible_nick run_hook sl tell_error tell_question | ||||||||||||||||||||||||||||||||
| 22 | 1 | xtell); | |||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Exporter (); | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use vars qw($VERSION @ISA @EXPORT_OK | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 26 | %Channel %Chan_limit %Chan_op %Chan_user %Chan_voice | ||||||||||||||||||||||||||||||||
| 27 | 1 | %Nick @Pend_userhost %User_chan %Userhost $Debug $Pkg); | |||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||
| 29 | 1 | $VERSION = do{my@r=q$Revision: 1.13 $=~/\d+/g;sprintf '%d.'.'%03d'x$#r,@r}; | |||||||||||||||||||||||||||||||
| 30 | 1 | ▶ | $VERSION .= '-l' if q$Locker: $ =~ /: \S/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||
| 32 | 1 | @ISA = qw(Exporter); | |||||||||||||||||||||||||||||||
| 33 | 1 | @EXPORT_OK = qw(%Channel %Chan_limit %Chan_op %Chan_user %Chan_voice | |||||||||||||||||||||||||||||||
| 34 | %Nick %User_chan chantrack_check chantrack_show); | ||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||
| 36 | 1 | $Debug = 0; | |||||||||||||||||||||||||||||||
| 37 | 1 | $Pkg = __PACKAGE__; | |||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||
| 39 | 1 | tie %Channel => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 40 | 1 | tie %Chan_limit => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 41 | 1 | tie %Chan_op => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 42 | 1 | tie %Chan_user => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 43 | 1 | tie %Chan_voice => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 44 | 1 | tie %Nick => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 45 | 1 | tie %Userhost => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 46 | 1 | tie %User_chan => 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||
| 48 | 1 | add_hook_type '+op'; | |||||||||||||||||||||||||||||||
| 49 | 1 | add_hook_type '-op'; | |||||||||||||||||||||||||||||||
| 50 | 1 | add_hook_type '+voice'; | |||||||||||||||||||||||||||||||
| 51 | 1 | add_hook_type '-voice'; | |||||||||||||||||||||||||||||||
| 52 | 1 | add_hook_type 'drop-user'; | |||||||||||||||||||||||||||||||
| 53 | 1 | add_hook_type 'limit'; | |||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | 1 | my $Old_w; | |||||||||||||||||||||||||||||||
| 56 | 1 | ▶ | BEGIN { $Old_w = $^W; $^W = 1 } | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 57 | 1 | { my @dummy = ($::user, $::host) } | |||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | 0 | ▶ | sub debug { | ||||||||||||||||||||||||||||||
|
Subroutine
debug: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | xtell "debug " . join '', @_ | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 61 | if $Debug; | ||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | sub userhost_split { | ||||||||||||||||||||||||||||||
|
Subroutine
userhost_split: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | unless (@_ == 1) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 66 | 0 | arg_count_error undef, 1, @_; | |||||||||||||||||||||||||||||||
| 67 | 0 | return (); | |||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||
| 69 | 0 | ▶ | return $_[0] =~ /^(.*?)\@(.*)/s ? ($1, $2) : (); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | sub add_user_channel { | ||||||||||||||||||||||||||||||
|
Subroutine
add_user_channel: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | unless (@_ == 4) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 74 | 0 | arg_count_error undef, 4, @_; | |||||||||||||||||||||||||||||||
| 75 | 0 | return; | |||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||
| 77 | 0 | my ($reason, $n, $c, $uh) = @_; | |||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||
| 79 | 0 | debug "$reason add $n to $c uh $uh"; | |||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | if (ieq $n, $::nick) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 81 | 0 | $Channel{$c} = 1; | |||||||||||||||||||||||||||||||
| 82 | $Chan_limit{$c} = $::limit{lc $c} | ||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | if exists $::limit{lc $c}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 84 | 0 | tie %{ $Chan_user{$c} }, 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 85 | 0 | tie %{ $Chan_op{$c} }, 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 86 | 0 | tie %{ $Chan_voice{$c} }, 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||
| 88 | 0 | ▶ | if (!exists $Nick{$n}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 89 | 0 | $Nick{$n} = $n; | |||||||||||||||||||||||||||||||
| 90 | 0 | tie %{ $User_chan{$n} }, 'Sirc::LckHash'; | |||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | $Userhost{$n} = [userhost_split $uh] | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 93 | if defined $uh; | ||||||||||||||||||||||||||||||||
| 94 | 0 | $Chan_user{$c}{$n} = 1; | |||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||
| 96 | 0 | $User_chan{$n}{$c} = 1; | |||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | sub drop_user { | ||||||||||||||||||||||||||||||
|
Subroutine
drop_user: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | unless (@_ == 2) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 101 | 0 | arg_count_error undef, 2, @_; | |||||||||||||||||||||||||||||||
| 102 | 0 | return; | |||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||
| 104 | 0 | my ($reason, $n) = @_; | |||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | if (ieq $n, $::nick) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 107 | 0 | debug "$reason drop everything"; | |||||||||||||||||||||||||||||||
| 108 | 0 | %Channel = %Chan_limit = %Chan_user = %Chan_op = %Chan_voice | |||||||||||||||||||||||||||||||
| 109 | = %Nick = %Userhost = %User_chan = (); | ||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||
| 111 | else { | ||||||||||||||||||||||||||||||||
| 112 | 0 | debug "$reason drop $n"; | |||||||||||||||||||||||||||||||
| 113 | 0 | my @c = keys %{ $User_chan{$n} }; | |||||||||||||||||||||||||||||||
| 114 | 0 | run_hook 'drop-user', $n, @c; | |||||||||||||||||||||||||||||||
| 115 | 0 | for my $c (@c) { | |||||||||||||||||||||||||||||||
| 116 | 0 | delete $Chan_user{$c}{$n}; | |||||||||||||||||||||||||||||||
| 117 | 0 | delete $Chan_op{$c}{$n}; | |||||||||||||||||||||||||||||||
| 118 | 0 | delete $Chan_voice{$c}{$n}; | |||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||
| 120 | 0 | delete $Nick{$n}; | |||||||||||||||||||||||||||||||
| 121 | 0 | delete $Userhost{$n}; | |||||||||||||||||||||||||||||||
| 122 | 0 | delete $User_chan{$n}; | |||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | sub drop_user_channel { | ||||||||||||||||||||||||||||||
|
Subroutine
drop_user_channel: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | unless (@_ == 3) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 128 | 0 | arg_count_error undef, 3, @_; | |||||||||||||||||||||||||||||||
| 129 | 0 | return; | |||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||
| 131 | 0 | my ($reason, $n, $c) = @_; | |||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||
| 133 | 0 | delete $Chan_user{$c}{$n}; | |||||||||||||||||||||||||||||||
| 134 | 0 | delete $Chan_op{$c}{$n}; | |||||||||||||||||||||||||||||||
| 135 | 0 | delete $Chan_voice{$c}{$n}; | |||||||||||||||||||||||||||||||
| 136 | 0 | delete $User_chan{$n}{$c}; | |||||||||||||||||||||||||||||||
| 137 | # XXX bug, scalar tied hash is always 0 | ||||||||||||||||||||||||||||||||
| 138 | 0 | ▶ | if (!keys %{ $User_chan{$n} }) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 139 | # That's the only channel this user was on, drop her entirely. | ||||||||||||||||||||||||||||||||
| 140 | 0 | debug "$reason drop $n from $c"; | |||||||||||||||||||||||||||||||
| 141 | 0 | delete $Nick{$n}; | |||||||||||||||||||||||||||||||
| 142 | 0 | delete $Userhost{$n}; | |||||||||||||||||||||||||||||||
| 143 | 0 | delete $User_chan{$n}; | |||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||
| 145 | else { | ||||||||||||||||||||||||||||||||
| 146 | 0 | debug "$reason drop $n from $c (partial)"; | |||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | if (ieq $n, $::nick) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 150 | 0 | debug "$reason drop channel $c"; | |||||||||||||||||||||||||||||||
| 151 | 0 | for my $tn (keys %{ $Chan_user{$c} }) { | |||||||||||||||||||||||||||||||
| 152 | 0 | drop_user_channel("self-$reason", $tn, $c); | |||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||
| 154 | 0 | delete $Channel{$c}; | |||||||||||||||||||||||||||||||
| 155 | 0 | delete $Chan_limit{$c}; | |||||||||||||||||||||||||||||||
| 156 | 0 | delete $Chan_user{$c}; | |||||||||||||||||||||||||||||||
| 157 | 0 | delete $Chan_op{$c}; | |||||||||||||||||||||||||||||||
| 158 | 0 | delete $Chan_voice{$c}; | |||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | sub main::hook_chantrack_join { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_join: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 163 | 0 | my ($c) = @_; | |||||||||||||||||||||||||||||||
| 164 | 0 | my $uh = "$::user\@$::host"; | |||||||||||||||||||||||||||||||
| 165 | 0 | add_user_channel 'join', $::who, $c, $uh; | |||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||
| 167 | 1 | addhook 'join', 'chantrack_join'; | |||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | sub main::hook_chantrack_leave { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_leave: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 170 | 0 | my ($c) = @_; | |||||||||||||||||||||||||||||||
| 171 | 0 | drop_user_channel 'leave', $::who, $c; | |||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||
| 173 | 1 | addhook 'leave', 'chantrack_leave'; | |||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||
| 175 | 0 | ▶ | sub main::hook_chantrack_kick { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_kick: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 176 | 0 | my ($n, $c) = @_; | |||||||||||||||||||||||||||||||
| 177 | 0 | drop_user_channel 'kick', $n, $c; | |||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||
| 179 | 1 | addhook 'kick', 'chantrack_kick'; | |||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | sub main::hook_chantrack_signoff { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_signoff: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 182 | 0 | drop_user 'signoff', $::who; | |||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||
| 184 | 1 | addhook 'signoff', 'chantrack_signoff'; | |||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | sub main::hook_chantrack_disconnect { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_disconnect: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 187 | 0 | drop_user 'disconnect', $::nick; | |||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||
| 189 | 1 | addhook 'disconnect', 'chantrack_disconnect'; | |||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | sub main::hook_chantrack_nick { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_nick: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||
| 192 | 0 | my ($new_nick) = @_; | |||||||||||||||||||||||||||||||
| 193 | 0 | delete $Nick{$::who}; | |||||||||||||||||||||||||||||||
| 194 | 0 | $Nick{$new_nick} = $new_nick; | |||||||||||||||||||||||||||||||
| 195 | 0 | $Userhost{$new_nick} = delete $Userhost{$::who}; | |||||||||||||||||||||||||||||||
| 196 | 0 | $User_chan{$new_nick} = delete $User_chan{$::who}; | |||||||||||||||||||||||||||||||
| 197 | 0 | for my $c (keys %{ $User_chan{$new_nick} }) { | |||||||||||||||||||||||||||||||
| 198 | 0 | debug "rename $::who -> $new_nick on $c"; | |||||||||||||||||||||||||||||||
| 199 | 0 | $Chan_user{$c}{$new_nick} = delete $Chan_user{$c}{$::who}; | |||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | if (exists $Chan_op{$c}{$::who}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 201 | 0 | debug "op rename $::who -> $new_nick on $c"; | |||||||||||||||||||||||||||||||
| 202 | 0 | $Chan_op{$c}{$new_nick} = delete $Chan_op{$c}{$::who}; | |||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | if (exists $Chan_voice{$c}{$::who}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 205 | 0 | debug "voice rename $::who -> $new_nick on $c"; | |||||||||||||||||||||||||||||||
| 206 | 0 | $Chan_voice{$c}{$new_nick} = delete $Chan_voice{$c}{$::who}; | |||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||
| 210 | 1 | addhook 'nick', 'chantrack_nick'; | |||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | sub main::hook_chantrack_mode { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_mode: not called CC=19 SCAR=59.4
| |||||||||||||||||||||||||||||||||
| 213 | 0 | my ($chan, $rest) = @_; | |||||||||||||||||||||||||||||||
| 214 | 0 | my ($op, @arg) = split ' ', $rest; | |||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | return unless $chan =~ /^[\#&]/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||
| 218 | 0 | my ($char, $add); | |||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | while ($op =~ s/^([-+])?(.)//) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | if (defined $1) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 221 | 0 | $char = $1; | |||||||||||||||||||||||||||||||
| 222 | 0 | $add = ($char eq '+'); | |||||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||||||
| 224 | 0 | my $type = $2; | |||||||||||||||||||||||||||||||
| 225 | 0 | ▶ | my $arg = | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$type eq "l" and $add
MC/DC0%0/2
$type eq "l" and $add
$type eq "l"
$add
Truth table0%0/3
A and B
A= $type eq "l"B= $add
| |||||||||||||||||||||||||||||||||
| 226 | ($type eq 'l' && $add) | ||||||||||||||||||||||||||||||||
| 227 | ? shift(@arg) | ||||||||||||||||||||||||||||||||
| 228 | : $type =~ /[bkov]/ | ||||||||||||||||||||||||||||||||
| 229 | ? shift(@arg) | ||||||||||||||||||||||||||||||||
| 230 | : ''; | ||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||
| 232 | 0 | debug "mode $char$type arg $arg"; | |||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | if ($type eq 'o') { | ||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | if ($add && !$Chan_op{$chan}{$arg}) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$add and not $Sirc::Chantrack::Chan_op{$chan}{$arg}
MC/DC0%0/2
$add and not $Sirc::Chantrack::Chan_op{$chan}{$arg}
$add
not $Sirc::Chantrack::Chan_op{$chan}{$arg}
Truth table0%0/3
A and not(B)
A= $addB= not $Sirc::Chantrack::Chan_op{$chan}{$arg}
| |||||||||||||||||||||||||||||||||
| 236 | 0 | debug "mode op add $arg on $chan"; | |||||||||||||||||||||||||||||||
| 237 | 0 | $Chan_op{$chan}{$arg} = 1; | |||||||||||||||||||||||||||||||
| 238 | 0 | run_hook '+op', $chan, $arg; | |||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||
| 240 | ▶ | elsif (!$add && $Chan_op{$chan}{$arg}) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
not $add and $Sirc::Chantrack::Chan_op{$chan}{$arg}
MC/DC0%0/2
not $add and $Sirc::Chantrack::Chan_op{$chan}{$arg}
not $add
$Sirc::Chantrack::Chan_op{$chan}{$arg}
Truth table0%0/3
not(A) and B
A= not $addB= $Sirc::Chantrack::Chan_op{$chan}{$arg}
| |||||||||||||||||||||||||||||||||
| 241 | 0 | debug "mode op drop $arg on $chan"; | |||||||||||||||||||||||||||||||
| 242 | 0 | delete $Chan_op{$chan}{$arg}; | |||||||||||||||||||||||||||||||
| 243 | 0 | run_hook '-op', $chan, $arg; | |||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||
| 247 | elsif ($type eq 'v') { | ||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | if ($add && !$Chan_voice{$chan}{$arg}) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$add and not $Sirc::Chantrack::Chan_voice{$chan}{$arg}
MC/DC0%0/2
$add and not $Sirc::Chantrack::Chan_voice{$chan}{$arg}
$add
not $Sirc::Chantrack::Chan_voice{$chan}{$arg}
Truth table0%0/3
A and not(B)
A= $addB= not $Sirc::Chantrack::Chan_voice{$chan}{$arg}
| |||||||||||||||||||||||||||||||||
| 249 | 0 | debug "mode voice add $arg on $chan"; | |||||||||||||||||||||||||||||||
| 250 | 0 | $Chan_voice{$chan}{$arg} = 1; | |||||||||||||||||||||||||||||||
| 251 | 0 | run_hook '+voice', $chan, $arg; | |||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||||
| 253 | ▶ | elsif (!$add && $Chan_voice{$chan}{$arg}) { | |||||||||||||||||||||||||||||||
|
Condition0%0/3
not $add and $Sirc::Chantrack::Chan_voice{$chan}{$arg}
MC/DC0%0/2
not $add and $Sirc::Chantrack::Chan_voice{$chan}{$arg}
not $add
$Sirc::Chantrack::Chan_voice{$chan}{$arg}
Truth table0%0/3
not(A) and B
A= not $addB= $Sirc::Chantrack::Chan_voice{$chan}{$arg}
| |||||||||||||||||||||||||||||||||
| 254 | 0 | debug "mode voice drop $arg on $chan"; | |||||||||||||||||||||||||||||||
| 255 | 0 | delete $Chan_voice{$chan}{$arg}; | |||||||||||||||||||||||||||||||
| 256 | 0 | run_hook '-voice', $chan, $arg; | |||||||||||||||||||||||||||||||
| 257 | } | ||||||||||||||||||||||||||||||||
| 258 | } | ||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||
| 260 | elsif ($type eq 'l') { | ||||||||||||||||||||||||||||||||
| 261 | 0 | my $old = $Chan_limit{$chan}; | |||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | if ($add) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 263 | 0 | $Chan_limit{$chan} = $arg; | |||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||
| 265 | else { | ||||||||||||||||||||||||||||||||
| 266 | 0 | delete $Chan_limit{$chan}; | |||||||||||||||||||||||||||||||
| 267 | } | ||||||||||||||||||||||||||||||||
| 268 | 0 | run_hook 'limit', $chan, $old, $Chan_limit{$chan}; | |||||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||||||
| 271 | } | ||||||||||||||||||||||||||||||||
| 272 | 1 | addhook 'mode', 'chantrack_mode'; | |||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||
| 274 | 0 | ▶ | sub main::hook_chantrack_324 { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_324: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 275 | # You can't use getarg here or you screw the handling sirc itself does. | ||||||||||||||||||||||||||||||||
| 276 | 0 | my ($n, $c) = split ' ', $::args, 2; | |||||||||||||||||||||||||||||||
| 277 | 0 | main::hook_chantrack_mode $c, $::args; | |||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||
| 279 | 1 | addhook '324', 'chantrack_324'; | |||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||
| 281 | 0 | ▶ | sub interpret_names_flag { | ||||||||||||||||||||||||||||||
|
Subroutine
interpret_names_flag: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 282 | 0 | ▶ | unless (@_ == 3) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 283 | 0 | arg_count_error undef, 3, @_; | |||||||||||||||||||||||||||||||
| 284 | 0 | return; | |||||||||||||||||||||||||||||||
| 285 | } | ||||||||||||||||||||||||||||||||
| 286 | 0 | my ($n, $c, $flag) = @_; | |||||||||||||||||||||||||||||||
| 287 | |||||||||||||||||||||||||||||||||
| 288 | 0 | ▶ | if ($flag eq '@') { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | if (!exists $Chan_op{$c}{$n}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 290 | 0 | $Chan_op{$c}{$n} = 1; | |||||||||||||||||||||||||||||||
| 291 | 0 | run_hook '+op', $c, $n; | |||||||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||||||
| 293 | 0 | return; | |||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||
| 296 | # Not an op. | ||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | if (exists $Chan_op{$c}{$n}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 298 | 0 | delete $Chan_op{$c}{$n}; | |||||||||||||||||||||||||||||||
| 299 | 0 | run_hook '-op', $c, $n; | |||||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||
| 302 | 0 | ▶ | if ($flag eq '+') { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 303 | 0 | ▶ | if (!exists $Chan_voice{$c}{$n}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 304 | 0 | $Chan_voice{$c}{$n} = 1; | |||||||||||||||||||||||||||||||
| 305 | 0 | run_hook '+voice', $c, $n; | |||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||
| 307 | 0 | return; | |||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||
| 310 | # No voice. | ||||||||||||||||||||||||||||||||
| 311 | 0 | ▶ | if (exists $Chan_voice{$c}{$n}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 312 | 0 | delete $Chan_voice{$c}{$n}; | |||||||||||||||||||||||||||||||
| 313 | 0 | run_hook '-voice', $c, $n; | |||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||
| 317 | 0 | ▶ | sub main::hook_chantrack_names { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_names: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||
| 318 | 0 | my ($rest) = @_; | |||||||||||||||||||||||||||||||
| 319 | 0 | my ($x1, $x2, $chan, $list) = split ' ', $rest, 4; | |||||||||||||||||||||||||||||||
| 320 | 0 | ▶ | return unless $Channel{$chan}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 321 | 0 | $list =~ s/^://; | |||||||||||||||||||||||||||||||
| 322 | 0 | for my $who (split ' ', $list) { | |||||||||||||||||||||||||||||||
| 323 | 0 | ▶ | my $flag = ($who =~ s/^([+@])//) ? $1 : ''; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | if (!exists $Chan_user{$chan}{$who}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 325 | 0 | add_user_channel 'names', $who, $chan, undef; | |||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||
| 327 | 0 | interpret_names_flag $who, $chan, $flag; | |||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||||||
| 330 | 1 | addhook '353', 'chantrack_names'; | |||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||
| 332 | 1 | ▶ | BEGIN { undef &main::userhost } | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 333 | 0 | ▶ | sub main::userhost { | ||||||||||||||||||||||||||||||
|
Subroutine
userhost: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||
| 334 | 0 | ▶ | unless (@_ == 2 || @_ == 3) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@_ == 2 or @_ == 3
MC/DC0%0/2
@_ == 2 or @_ == 3
@_ == 2
@_ == 3
Truth table0%0/3
A or B
A= @_ == 2B= @_ == 3
| |||||||||||||||||||||||||||||||||
| 335 | 0 | arg_count_error undef, '2 or 3', @_; | |||||||||||||||||||||||||||||||
| 336 | 0 | return; | |||||||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||||||
| 338 | 0 | my ($n, $rhave, $rhavenot) = @_; | |||||||||||||||||||||||||||||||
| 339 | 0 | my (@full, @missing); | |||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||
| 341 | 0 | ▶ | $rhavenot ||= sub { tell_question "Cannot find $::who on irc" }; | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$rhavenot ||= sub {
tell_question("Cannot find $main::who on irc");
}
MC/DC0%0/2
$rhavenot ||= sub {
tell_question("Cannot find $main::who on irc");
}
$rhavenot
sub {
tell_question("Cannot find $main::who on irc");
}
Truth table0%0/3
A ||= B
A= $rhavenotB= sub {
tell_question("Cannot find $main::who on irc");
}
| |||||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | @full = ref $n ? @$n : ($n); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||||||
| 344 | # Process entries for which I already have the userhost info | ||||||||||||||||||||||||||||||||
| 345 | # immediately. | ||||||||||||||||||||||||||||||||
| 346 | 0 | for my $n (@full) { | |||||||||||||||||||||||||||||||
| 347 | 0 | ▶ | if (!plausible_nick $n) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 348 | 0 | tell_error "Invalid nick `$n'"; | |||||||||||||||||||||||||||||||
| 349 | } | ||||||||||||||||||||||||||||||||
| 350 | elsif ($Userhost{$n}) { | ||||||||||||||||||||||||||||||||
| 351 | 0 | debug "userhost already have $n"; | |||||||||||||||||||||||||||||||
| 352 | 0 | local ($::who, $::user, $::host) = ($n, @{ $Userhost{$n} }); | |||||||||||||||||||||||||||||||
| 353 | 0 | eval_verbose 'immediate userhost', $rhave; | |||||||||||||||||||||||||||||||
| 354 | } | ||||||||||||||||||||||||||||||||
| 355 | else { | ||||||||||||||||||||||||||||||||
| 356 | 0 | debug "userhost needs $n"; | |||||||||||||||||||||||||||||||
| 357 | 0 | push @missing, $n; | |||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||
| 359 | } | ||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||
| 361 | # Queue USERHOST commands for the rest, 5 at a time. | ||||||||||||||||||||||||||||||||
| 362 | 0 | ▶ | while (@missing) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 363 | 0 | my @this = splice @missing, 0, 5; | |||||||||||||||||||||||||||||||
| 364 | 0 | debug "doing userhost for @this"; | |||||||||||||||||||||||||||||||
| 365 | 0 | sl "USERHOST @this"; | |||||||||||||||||||||||||||||||
| 366 | push @Pend_userhost, [ | ||||||||||||||||||||||||||||||||
| 367 | $rhave, | ||||||||||||||||||||||||||||||||
| 368 | $rhavenot, | ||||||||||||||||||||||||||||||||
| 369 | 0 | { map { lc($_) => $_ } @this }, | |||||||||||||||||||||||||||||||
| 370 | [ @this ], | ||||||||||||||||||||||||||||||||
| 371 | ]; | ||||||||||||||||||||||||||||||||
| 372 | } | ||||||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||||||
| 375 | 0 | ▶ | sub main::hook_chantrack_userhost { | ||||||||||||||||||||||||||||||
|
Subroutine
hook_chantrack_userhost: not called CC=10 SCAR=47.0
| |||||||||||||||||||||||||||||||||
| 376 | 0 | my ($x, @repl) = split ' ', $::args; | |||||||||||||||||||||||||||||||
| 377 | 0 | my (@parsed); | |||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||
| 379 | # Since sirc's userhost parsing code is wrapped in the main raw_irc | ||||||||||||||||||||||||||||||||
| 380 | # loop the only way I can override it is by setting $::skip. | ||||||||||||||||||||||||||||||||
| 381 | 0 | $::skip = 1; | |||||||||||||||||||||||||||||||
| 382 | |||||||||||||||||||||||||||||||||
| 383 | # Parse the response. | ||||||||||||||||||||||||||||||||
| 384 | 0 | ▶ | $repl[0] =~ s/^:// | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 385 | if @repl; | ||||||||||||||||||||||||||||||||
| 386 | 0 | for (@repl) { | |||||||||||||||||||||||||||||||
| 387 | 0 | ▶ | next unless /^(\S+?)\*?=[+\-](.*?)\@(.*)/; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 388 | 0 | my ($n, $u, $h) = ($1, $2, $3); | |||||||||||||||||||||||||||||||
| 389 | 0 | push @parsed, [$n, $u, $h]; | |||||||||||||||||||||||||||||||
| 390 | } | ||||||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||||||
| 392 | # Check that the request at the head of the queue matches this | ||||||||||||||||||||||||||||||||
| 393 | # response. Invalid nicks will not be present in the response, so | ||||||||||||||||||||||||||||||||
| 394 | # just verify that nicks which are present were requested. | ||||||||||||||||||||||||||||||||
| 395 | 0 | ▶ | unless (@Pend_userhost) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 396 | 0 | tell_error "USERHOST received without pending request"; | |||||||||||||||||||||||||||||||
| 397 | 0 | return; | |||||||||||||||||||||||||||||||
| 398 | } | ||||||||||||||||||||||||||||||||
| 399 | 0 | for my $rparsed (@parsed) { | |||||||||||||||||||||||||||||||
| 400 | 0 | my $n = $rparsed->[0]; | |||||||||||||||||||||||||||||||
| 401 | 0 | ▶ | if (!$Pend_userhost[0][2]{lc $n}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 402 | 0 | tell_error "USERHOST mismatch, nick $n not in request " | |||||||||||||||||||||||||||||||
| 403 | 0 | . "@{ $Pend_userhost[0][3] }"; | |||||||||||||||||||||||||||||||
| 404 | 0 | return; | |||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||
| 406 | } | ||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||
| 408 | # Break apart and remove the @Pend_userhost entry. | ||||||||||||||||||||||||||||||||
| 409 | 0 | my ($rhave, $rhavenot, $rmap, $rlist) = @{ shift @Pend_userhost }; | |||||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||||||
| 411 | # Loop through the nicks present in the request, saving the data (if | ||||||||||||||||||||||||||||||||
| 412 | # appropriate) and calling the $rhave sub. | ||||||||||||||||||||||||||||||||
| 413 | 0 | foreach (@parsed) { | |||||||||||||||||||||||||||||||
| 414 | 0 | my ($n, $u, $h) = @$_; | |||||||||||||||||||||||||||||||
| 415 | 0 | delete $rmap->{lc $n}; | |||||||||||||||||||||||||||||||
| 416 | $Userhost{$n} = [$u, $h] | ||||||||||||||||||||||||||||||||
| 417 | 0 | ▶ | if exists $Nick{$n}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 418 | 0 | local ($::who, $::user, $::host) = ($n, $u, $h); | |||||||||||||||||||||||||||||||
| 419 | 0 | eval_verbose 'delayed userhost', $rhave; | |||||||||||||||||||||||||||||||
| 420 | } | ||||||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||||||
| 422 | # Run $rhavenot for nicks still left in $rmap. | ||||||||||||||||||||||||||||||||
| 423 | 0 | foreach (values %{ $rmap }) { | |||||||||||||||||||||||||||||||
| 424 | 0 | local ($::who, $::user, $::host) = ($_); | |||||||||||||||||||||||||||||||
| 425 | 0 | eval_verbose 'failed userhost', $rhavenot; | |||||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||||||
| 428 | 1 | addhook '302', 'chantrack_userhost'; | |||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||
| 430 | 0 | ▶ | sub chantrack_show { | ||||||||||||||||||||||||||||||
|
Subroutine
chantrack_show: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 431 | 0 | for my $chan (sort keys %Chan_user) { | |||||||||||||||||||||||||||||||
| 432 | 0 | xtell "Channel $chan:"; | |||||||||||||||||||||||||||||||
| 433 | 0 | for my $user (sort keys %{ $Chan_user{$chan} }) { | |||||||||||||||||||||||||||||||
| 434 | xtell sprintf ' %-12s %s', | ||||||||||||||||||||||||||||||||
| 435 | ($Chan_op{$chan}{$user} ? '@' | ||||||||||||||||||||||||||||||||
| 436 | : $Chan_voice{$chan}{$user} ? '+' : '') . $Nick{$user}, | ||||||||||||||||||||||||||||||||
| 437 | 0 | ▶ | join '@', @{ $Userhost{$user} }; | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 438 | } | ||||||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||||
| 440 | } | ||||||||||||||||||||||||||||||||
| 441 | |||||||||||||||||||||||||||||||||
| 442 | 0 | ▶ | sub chantrack_check { | ||||||||||||||||||||||||||||||
|
Subroutine
chantrack_check: not called CC=5 SCAR=28.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 443 | 0 | my (@d, %d); | |||||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||||||
| 445 | 0 | @d = (); | |||||||||||||||||||||||||||||||
| 446 | 0 | for (qw(Channel Chan_op Chan_user Chan_voice)) { | |||||||||||||||||||||||||||||||
| 447 | 0 | ▶ | push @d, [$_, join ' ', sort do { no strict 'refs'; keys %{ $_ } }]; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||||||
| 448 | } | ||||||||||||||||||||||||||||||||
| 449 | 0 | ▶ | while (@d > 1) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 450 | 0 | ▶ | $d[0][1] eq $d[1][1] | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 451 | or print "Channel mismatch between $d[0][0] and $d[1][0]\n"; | ||||||||||||||||||||||||||||||||
| 452 | 0 | shift @d; | |||||||||||||||||||||||||||||||
| 453 | } | ||||||||||||||||||||||||||||||||
| 454 | # XXX more checks | ||||||||||||||||||||||||||||||||
| 455 | |||||||||||||||||||||||||||||||||
| 456 | 0 | require Data::Dumper; | |||||||||||||||||||||||||||||||
| 457 | 0 | my (@n, @v); | |||||||||||||||||||||||||||||||
| 458 | 0 | @n = qw(Channel Chan_limit Chan_op Chan_user Chan_voice | |||||||||||||||||||||||||||||||
| 459 | Nick Userhost User_chan); | ||||||||||||||||||||||||||||||||
| 460 | 0 | for (@n) { | |||||||||||||||||||||||||||||||
| 461 | 1 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 462 | 0 | push @v, \%$_; | |||||||||||||||||||||||||||||||
| 463 | } | ||||||||||||||||||||||||||||||||
| 464 | 0 | print Data::Dumper->Dump(\@v, [map { "r$_" } @n]); | |||||||||||||||||||||||||||||||
| 465 | } | ||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||
| 467 | 1 | ▶ | BEGIN { $^W = $Old_w } | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 468 | |||||||||||||||||||||||||||||||||
| 469 | 1 | 1; | |||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||
| 471 | __END__ | ||||||||||||||||||||||||||||||||