From 492cc42315070fb853ae4e06a24a92d23eafca6d Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sat, 10 Jul 2010 18:20:22 +0200 Subject: Include both keyword and full text in failure warnings in localmarkdown2sms. --- localmarkdown2sms | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'localmarkdown2sms') 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; } -- cgit v1.2.3