chiark
/
gitweb
/
~ian
/
nj-awaymsg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
47aa1f6
)
edit create
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 4 Sep 2012 20:35:38 +0000
(21:35 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 4 Sep 2012 20:35:38 +0000
(21:35 +0100)
mason/edit
patch
|
blob
|
history
diff --git
a/mason/edit
b/mason/edit
index 6edfbbc68e19f3f7d39c06cb661821e8a6c5230a..5e60d0932a2fe1c63bc6b566005eac2e0b892814 100755
(executable)
--- a/
mason/edit
+++ b/
mason/edit
@@
-22,9
+22,19
@@
if (defined $create) {
die unless defined $textid;
}
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"; }
if (!$tx) { die "no such text $textid"; }