$message =~ s/[\cA-\c_]//ig; # strip control characters
$message =~ s/^\s+//; # initial whitespaces.
$who =~ tr/A-Z/a-z/; # lowercase.
+ my $mynick = $conn->nick();
&showProc();
if ($msgType =~ /private/) {
# private messages.
$addressed = 1;
+ if (&IsChanConf('addressCharacter') > 0) {
+ $addressCharacter = getChanConf('addressCharacter');
+ if ($message =~ s/^\Q$addressCharacter\E//) {
+ &msg($who, "The addressCharacter \"$addressCharacter\" is to get my attention in a normal channel. Please leave it off when messaging me directly.");
+ }
+ }
} else {
# public messages.
# addressing revamped by the xk.
### below needs to be fixed...
- if (&IsParam("addressCharacter")) {
- if ($message =~ s/^\Q$param{'addressCharacter'}\E//) {
+ if (&IsChanConf('addressCharacter') > 0) {
+ $addressCharacter = getChanConf('addressCharacter');
+ if ($message =~ s/^\Q$addressCharacter\E//) {
$addrchar = 1;
$addressed = 1;
}
if ($message =~ /^($mask{nick})([\;\:\>\, ]+) */) {
my $newmessage = $';
- if ($1 =~ /^\Q$ident\E$/i) {
+ if ($1 =~ /^\Q$mynick\E$/i) {
$message = $newmessage;
$addressed = 1;
} else {
if ($addressed) {
my $time = $flood{$floodwho}{$message} || 0;
- if ($msgType eq "public" and (time() - $time < $interval)) {
+ if (!&hasFlag("o") and $msgType eq "public" and (time() - $time < $interval)) {
### public != personal who so the below is kind of pointless.
my @who;
foreach (keys %flood) {
}
if ($addrchar) {
- &status("$b_cyan$who$ob is short-addressing me");
+ &status("$b_cyan$who$ob is short-addressing $mynick");
} elsif ($msgType eq "private") { # private.
- &status("$b_cyan$who$ob is /msg'ing me");
+ &status("$b_cyan$who$ob is /msg'ing $mynick");
} else { # public?
- &status("$b_cyan$who$ob is addressing me");
+ &status("$b_cyan$who$ob is addressing $mynick");
}
$flood{$floodwho}{$message} = time();
- } elsif ($msgType eq "public" and &IsChanConf("kickOnRepeat")) {
+ } elsif ($msgType eq "public" and &IsChanConf("kickOnRepeat") > 0) {
# unaddressed, public only.
### TODO: use a separate "short-time" hash.
$seencache{$who}{'msg'} = $orig{message};
$seencache{$who}{'msgcount'}++;
}
-
+ if (&IsChanConf("minVolunteerLength") > 0) {
+ # FIXME hack to treat unaddressed as if using addrchar
+ $addrchar = 1;
+ }
return if ($skipmessage);
- return unless (&IsParam("minVolunteerLength") or $addressed);
+ return unless ($addrchar or $addressed);
foreach (@ignore) {
s/\*/\\S*/g;
$chan = $c;
my $l = $channels{$chan}{'l'};
- return unless (&IsChanConf("chanlimitcheck"));
+ return unless (&IsChanConf("chanlimitcheck") > 0);
if (scalar keys %netsplit) {
&WARN("clV: netsplit active (1, chan = $chan); skipping.");
&DEBUG("chanServCheck: lowercased chan ($chan)");
}
- if (! &IsChanConf("chanServ_ops") ) {
+ if (! &IsChanConf("chanServ_ops") > 0) {
return 0;
}