X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=nj-awaymsg.git;a=blobdiff_plain;f=mason%2Fedit;h=5e60d0932a2fe1c63bc6b566005eac2e0b892814;hp=6edfbbc68e19f3f7d39c06cb661821e8a6c5230a;hb=dce06504e5f9a73e8d3da414023bbf05ef31e3b3;hpb=47aa1f68c037b4f199b66740c94f837a7110ca2f diff --git a/mason/edit b/mason/edit index 6edfbbc..5e60d09 100755 --- a/mason/edit +++ b/mason/edit @@ -22,9 +22,19 @@ if (defined $create) { die unless defined $textid; } -my $sth = $dbh->prepare("SELECT * FROM texts WHERE textid=?"); -$sth->execute($textid); -my $tx = $sth->fetchrow_hashref();# +my $tx; + +if ($ARGS{'create'}) { + my $date = `date --iso-8601=minutes`; chomp $date or die; + $tx = { desc => "Message created $date", + subject => "Away from my email", + textid => "new", + text => "" }; +} else { + my $sth = $dbh->prepare("SELECT * FROM texts WHERE textid=?"); + $sth->execute($textid); + $tx = $sth->fetchrow_hashref();# +} if (!$tx) { die "no such text $textid"; }