summaryrefslogtreecommitdiff
path: root/localmarkdown2sms
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-07-10 18:20:22 +0200
committerJonas Smedegaard <dr@jones.dk>2010-07-10 18:20:22 +0200
commit492cc42315070fb853ae4e06a24a92d23eafca6d (patch)
tree1684db82b99260dc1356b7b197ca7c896b7db099 /localmarkdown2sms
parentfe0951b5a7bf4481c4be479b5a469398714f38f1 (diff)
Include both keyword and full text in failure warnings in localmarkdown2sms.
Diffstat (limited to 'localmarkdown2sms')
-rwxr-xr-xlocalmarkdown2sms6
1 files changed, 4 insertions, 2 deletions
diff --git a/localmarkdown2sms b/localmarkdown2sms
index c18dd01..662a20c 100755
--- a/localmarkdown2sms
+++ b/localmarkdown2sms
@@ -68,6 +68,7 @@ if ($urldecode) {
@ARGV = uri_unescape(@ARGV);
}
my ($phone) = shift @ARGV;
+my $inputstring = join(' ', @ARGV);
my ($key) = lc (shift @ARGV);
# strip international prefix
@@ -252,9 +253,10 @@ my $num_children = $#{ $reply{$key} } + 1; # How many children we'll create
if (0 == $num_children) {
my $err_en = "Sorry, not recognized as a keyword: Please check spelling and try again.";
my $err_it = "Spiacente, non riconosco come parola chiave: Controlla l'ortografia e riprova.";
+ my $errmsg = "[warning] $phone requested unknown keyword \"$key\"\nFull text: $inputstring";
&sendmsg($sms_phone, $phone, "fallback message", "$key?\n$err_it\n$err_en");
- ($sms_errto1) and &sendmsg($sms_errfrom, $sms_errto1, "warning", "[warning] $phone wrote: $key");
- ($sms_errto2) and &sendmsg($sms_errfrom, $sms_errto2, "warning", "[warning] $phone wrote: $key");
+ ($sms_errto1) and &sendmsg($sms_errfrom, $sms_errto1, "warning", $errmsg);
+ ($sms_errto2) and &sendmsg($sms_errfrom, $sms_errto2, "warning", $errmsg);
exit;
}