]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/IrcHelpers.pl
allow per-channel addressCharacter
[infobot.git] / src / IRC / IrcHelpers.pl
index e620b2202bfa8e85d1e152abd5b2c56d3bd47e1d..13f44695b800463a2ff98383c909f2b59055f6d4 100644 (file)
@@ -91,12 +91,19 @@ sub hookMsg {
     if ($msgType =~ /private/) {
        # private messages.
        $addressed = 1;
+       if (&IsChanConf('addressCharacter')) {
+           $addressCharacter = getChanConf('addressCharacter');
+           if ($message =~ s/^\Q$addressCharacter\E//) {
+               &msg($who, "please don't use the the addressCharacter when private messaging");
+           }
+       }
     } 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')) {
+           $addressCharacter = getChanConf('addressCharacter');
+           if ($message =~ s/^\Q$addressCharacter\E//) {
                $addrchar  = 1;
                $addressed = 1;
            }