- if ($param{'DBType'} =~ /^mysql|pg|postgres/i) {
- foreach $nick (keys %seencache) {
- if (0) {
- #BROKEN#
- my $retval = &dbReplace("seen", "nick", $nick, (
- "nick" => $seencache{$nick}{'nick'},
- "time" => $seencache{$nick}{'time'},
- "host" => $seencache{$nick}{'host'},
- "channel" => $seencache{$nick}{'chan'},
- "message" => $seencache{$nick}{'msg'},
- ) );
- &DEBUG("retval => $retval.");
- delete $seencache{$nick};
- $flushed++;
-
- next;
- }
- ### OLD CODE...
-
- my $exists = &dbGet("seen","nick", $nick, "nick");
-
- if (defined $exists and $exists) {
- &dbUpdate("seen", "nick", $nick, (
- "time" => $seencache{$nick}{'time'},
- "host" => $seencache{$nick}{'host'},
- "channel" => $seencache{$nick}{'chan'},
- "message" => $seencache{$nick}{'msg'},
- ) );
- $stats{'old'}++;
- } else {
- my $retval = &dbInsert("seen", $nick, (
- "nick" => $seencache{$nick}{'nick'},
- "time" => $seencache{$nick}{'time'},
- "host" => $seencache{$nick}{'host'},
- "channel" => $seencache{$nick}{'chan'},
- "message" => $seencache{$nick}{'msg'},
- ) );
- $stats{'new'}++;
-
- ### TODO: put bad nick into a list and don't do it again!
- &FIXME("Should never happen! (nick => $nick)") if !$retval;
- }
-
- delete $seencache{$nick};
- $flushed++;
- }
-
- } elsif ($param{'DBType'} =~ /^dbm/i) {
-