chiark / gitweb /
"out of office" -> away message
[nj-awaymsg.git] / AwayMsg.pm
index 483345524ee2dedb1eae5678b601e78e97494b70..1fa389908d2e7322f0ddceb70835c5869b452c1b 100644 (file)
@@ -12,7 +12,7 @@ BEGIN {
     our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
-    @EXPORT      = qw(db_connect db_commit expires2timet
+    @EXPORT      = qw(db_connect db_commit
                       $dbh);
     %EXPORT_TAGS = ( );
     @EXPORT_OK   = qw();
@@ -47,23 +47,11 @@ sub nooutput ($) {
     }
 }
 
-sub expires2timet ($) {
-    my ($str) = @_;
-    if ($str eq '') {
-       return undef;
-    }
-    open F, "-|", qw(date -d),'$str',qw(+%s) or die $!;
-    my $dtime = <F>;
-    $?=0; $!=0; close F or die "$? $!";
-    $dtime =~ m/^\d+$/ or die "$dtime ?";
-    return $dtime+0;
-}
-
 sub db_commit () {
     nooutput("SELECT * FROM addresses LEFT JOIN config".
             " USING (emailaddr) WHERE forwardfile IS NULL");
     nooutput("SELECT * FROM addresses LEFT JOIN texts".
-            " USING (textid) WHERE name IS NULL");
+            " USING (textid) WHERE desc IS NULL");
     $dbh->do("COMMIT");
 }