- if ($expected->[0] =~ /\*(.+)/) {
- # we expect *sessionname, so look up session's current nick
- my $exp = $1;
- $sender =~ /^(.+)!/;
- return 0 if lc($heap->{clients}->{$exp}->{nick}) ne lc($1);
- } elsif ($expected->[0] =~ /^:?(.+!.+)/) {
- # expect :nick!user@host, so compare whole thing
- return 0 if lc($1) ne lc($sender);
- } else {
- # we only expect :nick, so compare that part
- $sender =~ /^:?(.+)!/;
- return 0 if lc($expected->[0]) ne lc($1);
- }