#!/usr/bin/perl

BEGIN { $no_sms++ unless -e '/usr/bin/sms_client' }

sub sms_send {
	my ($to, $from, $what) = @_;
	return "No client software installed." if $no_sms;
	return "Don't know their SMS number." unless
		$number=get("is","$to\'s SMS number");
	$number=~s/^\+//;
	$number=~s/\s//g;
	$retcode=system ("/usr/bin/sms_client $number \"$what\"")/256;
	return "On its way" if $retcode == 0;
	return "That's too long" if $retcode ==1;
	return "Sorry, they mucked up their service/phone number" if $retcode==3;
	return "Couldn't grok the number" if $retcode==4;
	return "Freaky shit happened.";
}

"Yow!";
