]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Topic.pl
- last set of changes to convert from db*() to sql*()
[infobot.git] / src / Modules / Topic.pl
index 60e5c3b0f3594145a5423a24811d14ec17e829f8..2778fee53556e52fe8c459aa8aec73bdc226601d 100644 (file)
@@ -6,8 +6,8 @@
 #
 
 use strict;
-use vars qw(%topiccmp);
-no strict "refs";              ### FIXME!!!
+use vars qw(%topiccmp %topic %channels %orig);
+use vars qw($who $chan $conn $uh $ident);
 
 ###############################
 ##### INTERNAL FUNCTIONS
@@ -55,7 +55,7 @@ sub topicDecipher {
 # Usage: &topicCipher(@topics);
 sub topicCipher {
   if (!@_) {
-    &DEBUG("topicCipher: topic is NULL.");
+    &WARN("topicCipher: topic is NULL for $chan.");
     return;
   }
 
@@ -110,7 +110,7 @@ sub topicNew {
   $topic{$chan}{'Last'} = $topic;
   $topic{$chan}{'Who'}  = $orig{who}."!".$uh;
   $topic{$chan}{'Time'} = time();
-  rawout("TOPIC $chan :$topic");
+  $conn->topic($chan, $topic);
   &topicAddHistory($chan,$topic);
   return 1;
 }
@@ -390,7 +390,7 @@ sub Topic {
 
        undef @subtopics;                       # lets reuse this array.
        foreach (@newtopics) {
-         next if ($_ eq "");
+         next if (!defined $_ or $_ eq "");
          push(@subtopics, $_);
        }