chiark / gitweb /
"out of office" -> away message
[nj-awaymsg.git] / AwayMsg.pm
index e20d6b6acc39f5b825a8fce78657bc45c79c4494..1fa389908d2e7322f0ddceb70835c5869b452c1b 100644 (file)
@@ -5,13 +5,15 @@ use strict;
 use warnings;
 
 use DBI;
+use Data::Dumper;
 
 BEGIN {
     use Exporter ();
     our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
-    @EXPORT      = qw(&db_connect &db_commit $dbh);
+    @EXPORT      = qw(db_connect db_commit
+                      $dbh);
     %EXPORT_TAGS = ( );
     @EXPORT_OK   = qw();
 }
@@ -45,10 +47,11 @@ sub nooutput ($) {
     }
 }
 
-
 sub db_commit () {
-    nooutput("SELECT * FROM addresses LEFT JOIN config USING (emailaddr)");
-    nooutput("SELECT * FROM addresses LEFT JOIN texts USING (textid)");
+    nooutput("SELECT * FROM addresses LEFT JOIN config".
+            " USING (emailaddr) WHERE forwardfile IS NULL");
+    nooutput("SELECT * FROM addresses LEFT JOIN texts".
+            " USING (textid) WHERE desc IS NULL");
     $dbh->do("COMMIT");
 }