]> git.donarmstrong.com Git - infobot.git/commitdiff
closed 17187 -- <factoid> are also <info>' doesn't work... also removed mailto:
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 11 Aug 2000 13:21:44 +0000 (13:21 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 11 Aug 2000 13:21:44 +0000 (13:21 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@35 c11ca15a-4712-0410-83d8-924469b57eb5

src/Factoids/Reply.pl
src/Factoids/Update.pl

index ca542a4e2be916261c13593ee375ecbcb4eeced9..01d9e81b0d1afe3f0607f1500fbcd0715224b356 100644 (file)
@@ -124,9 +124,9 @@ sub getReply {
        # only remove '<reply>'
        if (!$real and $reply =~ s/^\s*<reply>\s*//i) {
            # 'are' fix.
-           if ($reply =~ s/^are //i) {
+           if ($reply =~ s/^are /$lhs are /i) {
                &DEBUG("Reply.pl: el-cheapo 'are' fix executed.");
-               $mhs = "are";
+               $mhs = "are";   # what's this for?
            }
 
        } elsif (!$real and $reply =~ s/^\s*<action>\s*(.*)/\cAACTION $1\cA/i) {
index 8f12e1dbbd874e943ca6fd04c0fc63e2a8f1f7d9..de6cfa78848f1ca756ff65e8fb4ce1811e12f3b9 100644 (file)
@@ -31,14 +31,8 @@ sub update {
        return $noreply;
     }
 
-    # nice 'are' hack (or work-around).
-    if ($mhs =~ /^are$/i and $rhs !~ /<\S+>/) {
-       $mhs = "is";
-       $rhs = "<REPLY> are ". $rhs;
-    }
-
     # invalid verb.
-    if ($mhs !~ /^is$/i) {
+    if ($mhs !~ /^(is|are)$/i) {
        &ERROR("UNKNOWN verb: $mhs.");
        return;
     }
@@ -67,8 +61,6 @@ sub update {
     }
 
     if (my $exists = &getFactoid($lhs)) {      # factoid exists.
-       chomp $exists;
-
        if ($exists eq $rhs) {
            &performAddressedReply("i already had it that way");
            return $noreply;
@@ -136,6 +128,14 @@ sub update {
            }
        }
     } else {                   # not exists.
+
+       # nice 'are' hack (or work-around).
+       if ($mhs =~ /^are$/i and $rhs !~ /<\S+>/) {
+           &DEBUG("Update: 'are' hack detected.");
+           $mhs = "is";
+           $rhs = "<REPLY> are ". $rhs;
+       }
+
        &status("enter: <$who> \'$lhs\' =$mhs=> \'$rhs\'");
        $count{'Update'}++;